|
|
|
@@ -100,7 +100,7 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt |
|
|
|
@PostMapping("/api/conversation") |
|
|
|
@ResponseBody |
|
|
|
public AjaxResult conversationApi(@RequestBody DmIntentVo intent) { |
|
|
|
log.info(intent.toString()); |
|
|
|
log.info("交互对象:{}", intent.toString()); |
|
|
|
redisTemplate.opsForValue().increment("dashboard:server", 1); |
|
|
|
R<DmManDeviceDto> manDeviceDtoR = manDeviceService.manDeviceInfoInner(intent.getDevId()); |
|
|
|
Source source = SourceUtil.getSourceCache(manDeviceDtoR.getData().getStrategyId()); |
|
|
|
@@ -194,7 +194,7 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt |
|
|
|
*/ |
|
|
|
@PostMapping("/inner/sendMessage") |
|
|
|
@ResponseBody |
|
|
|
public R sendMessage(@RequestBody DmWebSocketMessageVo message) { |
|
|
|
public R<Object> sendMessage(@RequestBody DmWebSocketMessageVo message) { |
|
|
|
|
|
|
|
log.info("websocket sendMessage:{}", message); |
|
|
|
if (message == null || message.getFormat() == null) { |
|
|
|
@@ -221,11 +221,11 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt |
|
|
|
*/ |
|
|
|
@PostMapping("/inner/taskGenerativeKnowledge") |
|
|
|
@ResponseBody |
|
|
|
public R taskGenerativeKnowledge() { |
|
|
|
public R<Object> taskGenerativeKnowledge() { |
|
|
|
|
|
|
|
// 从列表中获取知识库任务 |
|
|
|
TaskKnowledgeVo vo = (TaskKnowledgeVo) redisTemplate2.opsForList().leftPop("group:task"); |
|
|
|
log.info(vo.toString()); |
|
|
|
log.info("交互对象:{}",vo.toString()); |
|
|
|
if (vo == null) { |
|
|
|
return R.ok(null,"没有任务"); |
|
|
|
} |
|
|
|
@@ -235,11 +235,10 @@ public class DmIntentController extends BaseController<DmIntentQuery, DmIntentDt |
|
|
|
redisTemplate2.opsForList().rightPush("group:task", vo); |
|
|
|
return R.ok(null,"任务处理失败,重新放入队列"); |
|
|
|
} |
|
|
|
// TODO 更新对应数据库id状态 |
|
|
|
|
|
|
|
R<SysEnterpriseDto> enterpriseDtoR = enterpriseService.getInfo(vo.getTenantId()); |
|
|
|
if (enterpriseDtoR.isFail()) { |
|
|
|
log.warn("任务执行失败",vo); |
|
|
|
log.warn("任务执行失败:{}",vo); |
|
|
|
} |
|
|
|
Source source = SourceUtil.getSourceCache(enterpriseDtoR.getData().getStrategyId()); |
|
|
|
questionanswersService.batchInsertInner(vo.getManId(), JSONArray.from(joResult.get("questions")),vo.getTenantId(),source.getMaster(),SecurityConstants.INNER); |
|
|
|
|