Pārlūkot izejas kodu

天气接口很坑,要注意

tags/v1.1.0
qiujinyang pirms 2 gadiem
vecāks
revīzija
7906defa11
1 mainītis faili ar 17 papildinājumiem un 9 dzēšanām
  1. +17
    -9
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java

+ 17
- 9
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java Parādīt failu

@@ -205,20 +205,28 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi
//调用DSP接口
JSONObject jsonObject = new JSONObject();
jsonObject.put("requestId",thMission.getRequestId());
JSONObject responseJson = dspService.serviceStopApplication(jsonObject);
if(responseJson.getIntValue("code") == 0){
if(responseJson.containsKey("data") && ObjectUtil.isNotEmpty(responseJson.get("data"))) {
String requestId = responseJson.getJSONObject("data").getString("requestId");
log.info("dsp实时调用响应requestId:{}", requestId);
}else{
log.info("dsp实时调用响应:{}",responseJson);
JSONObject responseJson=new JSONObject();
try {
responseJson = dspService.serviceStopApplication(jsonObject);
if(responseJson.getIntValue("code") == 0){
if(responseJson.containsKey("data") && ObjectUtil.isNotEmpty(responseJson.get("data"))) {
String requestId = responseJson.getJSONObject("data").getString("requestId");
log.info("dsp实时调用响应requestId:{}", requestId);
}else{
log.info("dsp实时调用响应:{}",responseJson);
}
result=true;
}else {
log.error("dsp实时调用失败:{}", responseJson);
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.FAILED.getCode());
thMissionMapper.updateById(thMissionUpdate);
}
result=true;
}else {
}catch (Exception e){
log.error("dsp实时调用失败:{}", responseJson);
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.FAILED.getCode());
thMissionMapper.updateById(thMissionUpdate);
}

return result;
}


Notiek ielāde…
Atcelt
Saglabāt