diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index 85df654..3c86a70 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -355,21 +355,24 @@ public class AppController extends BaseController String URL = RequestParamsUtil.HTTP + ip + RequestParamsUtil.SEPARATOR + port + url; JSONObject jsonObject = new JSONObject(); String result; + TRecord tRecord = new TRecord(); + tRecord.setId(recordId); + tRecord.setStatus("1"); + tRecordService.updateTRecord(tRecord); try { result = HttpUtils.sendPost(URL, mapper.writeValueAsString(aiPostReq)); } catch (Exception e) { + tRecord.setStatus("0"); + tRecordService.updateTRecord(tRecord); throw new ServiceException(e.getMessage()); } if (!StringUtils.isEmpty(result)) { jsonObject = removeBase64Image(JSONObject.parseObject(result),recordId); - TRecord tRecord = new TRecord(); - tRecord.setId(recordId); - tRecord.setStatus("1"); tRecord.setUpdateTime(new Date()); tRecord.setAiResult(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue)); tRecord.setAiResult2(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue));