package cn.reghao.autodop.dmaster.mqttsub.rpcresult;

import cn.reghao.autodop.common.mqtt.DefaultMqttClient;
import cn.reghao.autodop.common.msg.rpc.RpcResult;
import cn.reghao.autodop.common.msg.rpc.clazz.MachineRpcClazz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author reghao
 * @date 2020-12-30 10:26:47
 */
@Slf4j
@Component
public class MachineRpcClazzResult {
    private final DefaultMqttClient mqttClient;

    public MachineRpcClazzResult(DefaultMqttClient mqttClient) {
        this.mqttClient = mqttClient;
    }

    public void process(String msgId, String method, RpcResult rpcResult) {
        mqttClient.removeRecord(msgId);
        switch (MachineRpcClazz.valueOf(method)) {
            case stat:
                break;
            case shell:
                break;
            default:
                ;
        }
    }
}
