package tech.glinfo.enbao.modules.mq;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tech.glinfo.enbao.common.utils.RedisUtils;
import tech.glinfo.enbao.modules.sh.entity.ShDeviceEntity;

import java.util.Map;

//智能马桶
@Component("toiletParse")
public class ToiletParse implements IParse {

    private final static Logger logger = LoggerFactory.getLogger(ToiletParse.class);

    @Autowired
    private RedisUtils redisUtils;

    @Autowired
    private TimeParseUtils timeParseUtils;

    @Override
    public Map<String, String> run(Object o, Map<String, String> datas) {
        ShDeviceEntity device = (ShDeviceEntity) o;
        if("01".equals(datas.get("cmd"))) {//实时数据

            //校验设备时钟
//            new Thread(() -> {
//                logger.info("start checkDeviceTime");
//                timeParseUtils.checkDeviceTime1(datas.get("receiveId"), datas.get("content").substring(16), "07");
//            }).start();
        }

        return datas;
    }
}
