Browse Source

修改:

1、修复bug,将返回值变为JSONObject
tags/B.2.7.0_20240201_base
10710 1 year ago
parent
commit
740b181e1b
1 changed files with 10 additions and 10 deletions
  1. +10
    -10
      xueyi-modules/xueyi-nlt/src/main/java/com/xueyi/nlt/nlt/controller/DmIntentController.java

+ 10
- 10
xueyi-modules/xueyi-nlt/src/main/java/com/xueyi/nlt/nlt/controller/DmIntentController.java View File

@@ -960,15 +960,15 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt
return AjaxResult.error(res);
}

// @PostMapping("/api/testforwelcome")
// public AjaxResult test(){
// JSONObject jo = generativeWelcomeTemplate.handle("1", "");
// Map<Object, Object> devices = redisTemplate2.opsForHash().entries("group:dgman:device:");
// for(Object devId:devices.keySet()){
// mqttTemplate.sendToMqtt("/" + activeProfile + "/" + "digital_man" + "/" + devId.toString() + "/" + "notify" + "/" + "generate-welcome", jo.getJSONArray("data").toJSONString());
// }
// return AjaxResult.success();
// }
@PostMapping("/api/testforwelcome")
public AjaxResult test(){
JSONObject jo = generativeWelcomeTemplate.handle("1", "");
Map<Object, Object> devices = redisTemplate2.opsForHash().entries("group:dgman:device:");
for(Object devId:devices.keySet()){
mqttTemplate.sendToMqtt("/" + activeProfile + "/" + "digital_man" + "/" + devId.toString() + "/" + "notify" + "/" + "generate-welcome", jo.toJSONString());
}
return AjaxResult.success();
}

@PostMapping("/inner/generateContextTask")
@ResponseBody
@@ -981,7 +981,7 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt
JSONObject jo = generativeWelcomeTemplate.handle("1", "");
Map<Object, Object> devices = redisTemplate2.opsForHash().entries("group:dgman:device:");
for(Object devId:devices.keySet()){
mqttTemplate.sendToMqtt("/" + activeProfile + "/" + "digital_man" + "/" + devId.toString() + "/" + "notify" + "/" + "generate-welcome", jo.getJSONArray("data").toJSONString());
mqttTemplate.sendToMqtt("/" + activeProfile + "/" + "digital_man" + "/" + devId.toString() + "/" + "notify" + "/" + "generate-welcome", jo.toJSONString());
}
} catch (Exception e) {
log.error("生成任务失败:{}",e.getMessage());


Loading…
Cancel
Save