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; + /** * 资源已被移除 */