package cn.iododer.yudao.module.mqtt.service;

import cn.iocoder.yudao.module.system.api.robot.RobotTaskStatusApi;
import cn.iocoder.yudao.module.system.api.robot.dto.RobotCompleteTaskDTO;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
@Slf4j
public class RobotTaskStatusServiceImpl implements MqttService {
    @Autowired
    private RobotTaskStatusApi robotTaskStatusApi;

    @Override
    public void analysisMessage(String message) {
        log.info("处理RobotTaskStatusServiceImpl的消息 :{}",message);
        RobotCompleteTaskDTO robotCompleteTask = JSON.parseObject(message , RobotCompleteTaskDTO.class);
        robotTaskStatusApi.robotDoneTask(robotCompleteTask);
    }
}
