From 9436a2c889711f5f2694bc79df232091ad2221de Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Fri, 19 Aug 2022 09:46:56 +0800 Subject: [PATCH] =?UTF-8?q?ai=E4=B8=8A=E4=BC=A0=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/web/controller/api/AppController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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));