From e9be9c0948b91113611aff691f5c1fd590909ce3 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Fri, 6 Jan 2023 17:28:00 +0800 Subject: [PATCH] =?UTF-8?q?AI=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/web/controller/api/AppController.java | 3 ++- .../src/main/java/com/ruoyi/common/constant/HttpStatus.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 9a3c829..623c14d 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 @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; @@ -474,7 +475,7 @@ public class AppController extends BaseController // AI接口异常,需要重置当前记录状态 updateRecordStatus(recordId, "0"); logger.error("AI result exception, msg is {}", e.getMessage()); - return AjaxResult.error("AI result exception, message is {}", e.getMessage()); + return AjaxResult.error(HttpStatus.AI_EXCEPTION, "AI接口调用失败"); } if (StringUtils.isEmpty(result)) { // AI接口非正常返回,需要重置当前记录状态 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java index d60afee..93584ba 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java @@ -27,6 +27,11 @@ public class HttpStatus */ public static final int NO_CONTENT = 204; + /** + * 操作已经执行成功,调用AI接口异常 + */ + public static final int AI_EXCEPTION = 206; + /** * 资源已被移除 */