xuhy
2025-01-07 88ac2574d89aed7c28b9c0370b19b8bb2d0364eb
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/produce/IotMessageProduce.java
@@ -26,18 +26,24 @@
    @Autowired
    private IotBuilder iotBuilder;
    @Autowired
    private IotDAConfig config;
    /**
     * 设备消息下发
     * @param deviceId 设备id
     * @param name 消息名称
     * @param message 消息内容
     * @return
     */
    @PostMapping("/sendMessage")
    public String sendMessage(String deviceId, String name, JSONObject message){
    public String sendMessage(String code, String name, JSONObject message){
        log.info("消息下发至设备:code={},name={},message={}", code, name, message);
        CreateMessageRequest request = new CreateMessageRequest();
        request.withDeviceId(deviceId);
        System.err.println(code);
        System.err.println(JSONObject.toJSONString(config));
        request.withDeviceId(code);
        DeviceMessageRequest body = new DeviceMessageRequest();
        body.withMessageId(UUID.randomUUID().toString());
        body.withName(name);