|
|
@@ -4,11 +4,13 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.zksy.pole.MQTTServer.request.MqttRequest;
|
|
|
import com.zksy.pole.MQTTServer.server.MQTTServer;
|
|
|
import com.zksy.pole.domain.dto.*;
|
|
|
+import com.zksy.pole.factory.HandleCmdFactory;
|
|
|
import com.zksy.pole.service.InstructionIssuanceServer;
|
|
|
import io.netty.buffer.Unpooled;
|
|
|
import io.netty.channel.Channel;
|
|
|
import io.netty.channel.ChannelId;
|
|
|
import io.netty.handler.codec.mqtt.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
@@ -25,13 +27,17 @@ import java.util.Map;
|
|
|
@Service
|
|
|
public class InstructionIssuanceServerImpl implements InstructionIssuanceServer {
|
|
|
private static final Map<String,Object> msgMap= new HashMap<>();
|
|
|
-
|
|
|
@Override
|
|
|
public String instructionIssuance(ReportEnvironmentalDataDto dto) {
|
|
|
Map<String, Object> fields = new HashMap<>();
|
|
|
fields.put("light_nums",dto.getLightNums());
|
|
|
fields.put("brightness",dto.getBrightness());
|
|
|
sendMqttMessage(dto,fields);
|
|
|
+ System.out.println("dto------>"+dto.getCmd());
|
|
|
+ System.out.println("dto------>"+dto.getBrightness());
|
|
|
+ System.out.println("dto------>"+dto.getLightNums());
|
|
|
+ System.out.println("dto------>"+dto.getPackageId());
|
|
|
+ System.out.println("f------->"+fields);
|
|
|
return "ok";
|
|
|
}
|
|
|
|