Browse Source

天气接口很坑,要注意

tags/v1.1.0
qiujinyang 2 years ago
parent
commit
7906defa11
1 changed files with 17 additions and 9 deletions
  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 View File

//调用DSP接口 //调用DSP接口
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("requestId",thMission.getRequestId()); 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); log.error("dsp实时调用失败:{}", responseJson);
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.FAILED.getCode()); thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.FAILED.getCode());
thMissionMapper.updateById(thMissionUpdate); thMissionMapper.updateById(thMissionUpdate);
} }

return result; return result;
} }



Loading…
Cancel
Save