ソースを参照

yinruoxi

feature:
    1.临时:注释不发布代码。
tags/B.2.8.3_20240316_release
kira 1年前
コミット
499466c0c5
1個のファイルの変更54行の追加54行の削除
  1. +54
    -54
      xueyi-modules/xueyi-nlt/src/main/java/com/xueyi/nlt/nlt/controller/DmIntentController.java

+ 54
- 54
xueyi-modules/xueyi-nlt/src/main/java/com/xueyi/nlt/nlt/controller/DmIntentController.java ファイルの表示

@@ -44,7 +44,7 @@ import com.xueyi.nlt.nlt.domain.LlmContext;
import com.xueyi.nlt.nlt.domain.LlmParam;
import com.xueyi.nlt.nlt.domain.LlmResponse;
import com.xueyi.nlt.nlt.domain.dto.DmIntentDto;
import com.xueyi.nlt.nlt.domain.dto.DmPromptDto;
//import com.xueyi.nlt.nlt.domain.dto.DmPromptDto;
import com.xueyi.nlt.nlt.domain.dto.DmSensitiveWordDto;
import com.xueyi.nlt.nlt.domain.po.DmRegularPo;
import com.xueyi.nlt.nlt.domain.query.DmIntentQuery;
@@ -146,8 +146,8 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt
@Autowired
private GenerativeKnowledgeTemplate generativeKnowledgeTemplate;

@Autowired
private GenerativeWelcomeTemplate generativeWelcomeTemplate;
//@Autowired
//private GenerativeWelcomeTemplate generativeWelcomeTemplate;

@Autowired
private FreeChatTemplate freeChatTemplate;
@@ -187,8 +187,8 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt
@Autowired
private ISysLlmService sysLlmService;

@Autowired
private IDmHotspotService dmHotspotService;
//@Autowired
//private IDmHotspotService dmHotspotService;

@Autowired
MqttTemplate mqttTemplate;
@@ -1135,55 +1135,55 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt
return AjaxResult.error(res);
}

@PostMapping("/inner/generateContextTask")
@ResponseBody
public AjaxResult generateContextTask() {
LocalDateTime dateTime = LocalDateTime.now();
String date = dateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<JSONObject> contentList = new ArrayList<>();
GenerativeWelcomeTemplate.lunar = "";
GenerativeWelcomeTemplate.term = null;
try {
JSONObject jo = generativeWelcomeTemplate.handle("1", "");
JSONArray ja = jo.getJSONArray("data");
Long timeStamp = System.currentTimeMillis();
JSONObject timeJson = new JSONObject();
timeJson.put("timestamp", timeStamp);
ja.add(timeJson);
log.info(ja.toJSONString());
redisTemplate2.opsForHash().put("group:task" + ":generate", date, AjaxResult.success(ja).toJson().toJSONString());
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", true, AjaxResult.success(ja).toJson().toJSONString());
}
} catch (Exception e) {
log.error("生成任务失败:{}",e.getMessage());
return AjaxResult.error("生成任务失败");
}
return AjaxResult.success();
}
@PostMapping("/syncHotspot")
@ResponseBody
public AjaxResult syncHotspot(){
Integer result = dmHotspotService.syncHotspot();
if(result.equals(0)){
return AjaxResult.success("同步成功");
}else {
return AjaxResult.error("同步失败");
}
}
@PostMapping("/collectHotspot")
@ResponseBody
public AjaxResult collectHotspot(){
Integer result = dmHotspotService.collectHotspot();
if(result.equals(0)){
return AjaxResult.success("热点收集成功");
}else {
return AjaxResult.error("热点收集失败");
}
}
// @PostMapping("/inner/generateContextTask")
// @ResponseBody
// public AjaxResult generateContextTask() {
// LocalDateTime dateTime = LocalDateTime.now();
// String date = dateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
// List<JSONObject> contentList = new ArrayList<>();
// GenerativeWelcomeTemplate.lunar = "";
// GenerativeWelcomeTemplate.term = null;
// try {
// JSONObject jo = generativeWelcomeTemplate.handle("1", "");
// JSONArray ja = jo.getJSONArray("data");
// Long timeStamp = System.currentTimeMillis();
// JSONObject timeJson = new JSONObject();
// timeJson.put("timestamp", timeStamp);
// ja.add(timeJson);
// log.info(ja.toJSONString());
// redisTemplate2.opsForHash().put("group:task" + ":generate", date, AjaxResult.success(ja).toJson().toJSONString());
// 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", true, AjaxResult.success(ja).toJson().toJSONString());
// }
// } catch (Exception e) {
// log.error("生成任务失败:{}",e.getMessage());
// return AjaxResult.error("生成任务失败");
// }
// return AjaxResult.success();
// }
// @PostMapping("/syncHotspot")
// @ResponseBody
// public AjaxResult syncHotspot(){
// Integer result = dmHotspotService.syncHotspot();
// if(result.equals(0)){
// return AjaxResult.success("同步成功");
// }else {
// return AjaxResult.error("同步失败");
// }
// }
// @PostMapping("/collectHotspot")
// @ResponseBody
// public AjaxResult collectHotspot(){
// Integer result = dmHotspotService.collectHotspot();
// if(result.equals(0)){
// return AjaxResult.success("热点收集成功");
// }else {
// return AjaxResult.error("热点收集失败");
// }
// }

interface Auth {
/** 系统 - 意图管理


読み込み中…
キャンセル
保存