From 4e6a3e28f4133dd82040abd84ce23b2353aeb402 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 31 May 2024 15:51:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=B3=BB=E7=BB=9F=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=97=B6=E6=A0=BC=E5=BC=8F=E5=8C=96=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=9A=84=E7=AD=94=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java | 6 ++++++ .../java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java index 712b2bf..47908f1 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.springblade.core.tool.utils.BeanUtil; import java.io.Serializable; @@ -47,4 +48,9 @@ public class AnswerVO implements Serializable { @ApiModelProperty("其它调用的参数") private Object[] extras; + public static void error(AnswerVO usualVO) { + usualVO.setRunning(0); + usualVO.setStatus(-2); + } + } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java index 759c3b8..32c132d 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java @@ -109,9 +109,9 @@ public class InteractiveSchedule { answerVO.setExtras(extraList.toArray(new String[extraList.size()])); } catch(Exception e) { - redisTemplate.opsForList().leftPush(HZIMS_BIGMODEL_ASK_KEY,answerVO.getSessionId()); e.printStackTrace(); - throw new RuntimeException(e); + AnswerVO.error(answerVO); + answerVO.setAnswer("非常抱歉,系统在处理您的请求时遇到了问题。请稍后再试或联系我们的客服团队。"); } } if(sessionIds.contains(answerVO.getSessionId())){