事件数据处理

This commit is contained in:
lxu75
2025-06-11 11:46:44 +08:00
parent 5d17420899
commit f173434235
2 changed files with 6 additions and 4 deletions

View File

@@ -20,7 +20,7 @@ public class CommunityEGEventController {
private SpokesManService spokesmanService; private SpokesManService spokesmanService;
@PostMapping("/spokesmanCallBack") @PostMapping("/spokesmanCallBack")
public void spokesmanCallBack(@RequestBody Object req){ public void spokesmanCallBack(@RequestBody String req){
log.info("社区特邀发言官入参", JSON.toJSONString(req)); log.info("社区特邀发言官入参", JSON.toJSONString(req));
spokesmanService.spokesManCallBack(req); spokesmanService.spokesManCallBack(req);
} }

View File

@@ -63,15 +63,17 @@ public class SpokesManService {
* *
* @param req SpokesManDTO 请求对象 * @param req SpokesManDTO 请求对象
*/ */
public void spokesManCallBack(Object req) { public void spokesManCallBack(String req) {
// 生成ai分析请求id // 生成ai分析请求id
String aiAnalysisRequestId = AiAnalysisUtils.getAiAnalysisRequestId(BusinessTypeEnum.COMMUNITYTARGET.getCode()); String aiAnalysisRequestId = AiAnalysisUtils.getAiAnalysisRequestId(BusinessTypeEnum.COMMUNITYTARGET.getCode());
try { try {
JSONObject jsonObject = JSON.parseObject(req);
String data = jsonObject.getString("data");
// 异步保存请求日志 // 异步保存请求日志
syncSaveRequestLogs(JSON.toJSONString(req), aiAnalysisRequestId); syncSaveRequestLogs(JSON.toJSONString(data), aiAnalysisRequestId);
//把req转成SpokesManDTO对象 //把req转成SpokesManDTO对象
SpokesManDTO spokesManDTO = JSON.parseObject(JSON.toJSONString(req), SpokesManDTO.class); SpokesManDTO spokesManDTO = JSON.parseObject(data, SpokesManDTO.class);
if (spokesManDTO == null || spokesManDTO.getFiles() == null || spokesManDTO.getFiles().isEmpty() if (spokesManDTO == null || spokesManDTO.getFiles() == null || spokesManDTO.getFiles().isEmpty()
|| spokesManDTO.getPlatform() == null || spokesManDTO.getTheme() == null) { || spokesManDTO.getPlatform() == null || spokesManDTO.getTheme() == null) {
log.error("社区特邀发言官入参错误"); log.error("社区特邀发言官入参错误");