package com.huangzj.server.cmd.cmds;

import com.huangzj.base.cmd.AbstractTypedPbCommand;
import com.huangzj.base.cmd.Cmd;
import com.huangzj.base.cmd.CommandContext;
import com.huangzj.base.cmd.CommandSource;
import com.huangzj.cmd.gen.CmdEchoCts;
import com.huangzj.cmd.gen.CmdEchoStc;
import com.huangzj.cmd.gen.PbService;
import com.huangzj.cmd.gen.Service1_Method;
import org.springframework.stereotype.Component;

/**
 * 路径1：客户端 → 区服，区服本地处理完直接回包（不经跨服）。
 */
@Component
@Cmd(source = CommandSource.Client_TCP, serviceId = PbService.Service_1_VALUE, methodId = Service1_Method.Method1_VALUE)
public class TcpPath1LocalEchoCommand extends AbstractTypedPbCommand<CmdEchoCts, CmdEchoStc.Builder> {

    @Override
    protected void run(CommandContext ctx, CmdEchoCts cts, CmdEchoStc.Builder stcBuilder) {
        stcBuilder.setText(cts.getText()).setServerTimeMs(System.currentTimeMillis());
    }
}
