事件数据处理
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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("社区特邀发言官入参错误");
|
||||||
|
|||||||
Reference in New Issue
Block a user