修改事件类型
This commit is contained in:
@@ -124,7 +124,7 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
|
|||||||
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
||||||
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
||||||
|
|
||||||
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()), ltoChannelId);
|
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString(), "DCC"), ltoChannelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -144,11 +144,12 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public CloudEvents setCloudEvents(String aiAnalysisRequestId, String text){
|
public CloudEvents setCloudEvents(String aiAnalysisRequestId, String text, String eventType){
|
||||||
|
log.info("setCloudEvents aiAnalysisRequestId:{},type:{}", aiAnalysisRequestId,eventType);
|
||||||
// 发送消息
|
// 发送消息
|
||||||
CloudEvents cloudEvents = new CloudEvents();
|
CloudEvents cloudEvents = new CloudEvents();
|
||||||
cloudEvents.setId(aiAnalysisRequestId);
|
cloudEvents.setId(aiAnalysisRequestId);
|
||||||
cloudEvents.setType("APPLICATION");
|
cloudEvents.setType(eventType);
|
||||||
cloudEvents.setSource(sourceId);
|
cloudEvents.setSource(sourceId);
|
||||||
cloudEvents.setSpecversion("1.0");
|
cloudEvents.setSpecversion("1.0");
|
||||||
cloudEvents.setDatacontenttype("application/json");
|
cloudEvents.setDatacontenttype("application/json");
|
||||||
@@ -218,13 +219,13 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
|
|||||||
corpusReportDTO.setUserId(userId);
|
corpusReportDTO.setUserId(userId);
|
||||||
corpusReportDTO.setAnalysisScene(1l);
|
corpusReportDTO.setAnalysisScene(1l);
|
||||||
// 获取配置
|
// 获取配置
|
||||||
JSONObject execDifyFlow = diFyService.executeDifyFlow(diFyImageReq, BusinessTypeEnum.SMART_ASSISTANT_QIWEI.getCode(), JSONObject.toJSONString(corpusReportDTO), null);
|
JSONObject execDifyFlow = diFyService.executeDifyFlow(diFyImageReq, BusinessTypeEnum.CORPUS_PORTRAIT_QIWEI.getCode(), JSONObject.toJSONString(corpusReportDTO), null);
|
||||||
log.info("runDify execDifyFlow {}", execDifyFlow);
|
log.info("runDify execDifyFlow {}", execDifyFlow);
|
||||||
String aiAnalysisRequestId = execDifyFlow.getString("aiAnalysisRequestId");
|
String aiAnalysisRequestId = execDifyFlow.getString("aiAnalysisRequestId");
|
||||||
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
||||||
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
||||||
|
|
||||||
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()),ltoChannelId);
|
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString(),"QIWEI"),ltoChannelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -268,13 +269,13 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
|
|||||||
corpusReportDTO.setAnalysisScene(3l);
|
corpusReportDTO.setAnalysisScene(3l);
|
||||||
corpusReportDTO.setCarModel(carModel);
|
corpusReportDTO.setCarModel(carModel);
|
||||||
// 获取配置
|
// 获取配置
|
||||||
JSONObject execDifyFlow = diFyService.executeDifyFlow(diFyImageReq, BusinessTypeEnum.SMART_ASSISTANT_NAMEPLATE.getCode(), JSONObject.toJSONString(corpusReportDTO),null);
|
JSONObject execDifyFlow = diFyService.executeDifyFlow(diFyImageReq, BusinessTypeEnum.CORPUS_PORTRAIT_NAMEPLATE.getCode(), JSONObject.toJSONString(corpusReportDTO),null);
|
||||||
log.info("runDify execDifyFlow {}", execDifyFlow);
|
log.info("runDify execDifyFlow {}", execDifyFlow);
|
||||||
String aiAnalysisRequestId = execDifyFlow.getString("aiAnalysisRequestId");
|
String aiAnalysisRequestId = execDifyFlow.getString("aiAnalysisRequestId");
|
||||||
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
||||||
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
||||||
|
|
||||||
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString()),ltoChannelId);
|
huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString(),"NAMEPLATE"),ltoChannelId);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("nameplate processItem error {}", e.getMessage());
|
log.error("nameplate processItem error {}", e.getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user