舆情自动化代码调整
This commit is contained in:
@@ -14,6 +14,7 @@ import com.volvo.common.core.util.ResultMsg;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -41,6 +42,9 @@ public class TestController {
|
||||
@Autowired
|
||||
private MqMessageRecordService mqMessageRecordService;
|
||||
|
||||
@Autowired
|
||||
private RocketMQTemplate rocketMQTemplate;
|
||||
|
||||
/*
|
||||
@PostMapping("/runWorkflows2")
|
||||
@ApiOperation(value = "测试Dify")
|
||||
@@ -88,5 +92,13 @@ public class TestController {
|
||||
mqMessageRecordService.processMessageByTask();
|
||||
return ResultMsg.ok("");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/mockMq")
|
||||
@ApiOperation(value = "补偿处理消息")
|
||||
public ResultMsg<Object> mockMq( String message) {
|
||||
rocketMQTemplate.syncSend("COMMUNITY_POST_TO_AI_TOPIC", JSON.toJSONString(message));
|
||||
return ResultMsg.ok("ok");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ public class MqMessageRecordServiceImpl extends ServiceImpl<MqMessageRecordMappe
|
||||
difyCommunityTargetResult.setTargetId(targetId);
|
||||
difyCommunityTargetResult.setCommentAnswer(commentAnswer);
|
||||
//返回结果推送到社区的MQ
|
||||
rocketMQTemplate.syncSend("", JSON.toJSONString(difyCommunityTargetResult));
|
||||
rocketMQTemplate.syncSend(topic, JSON.toJSONString(difyCommunityTargetResult));
|
||||
log.info("舆情分析发送回调MQ完成: {}", JSON.toJSONString(difyCommunityTargetResult));
|
||||
//异步更新请求日志表的difyResponse字段
|
||||
syncUpdateDiFyResponse(difResult, aiAnalysisRequestId);
|
||||
|
||||
Reference in New Issue
Block a user