From 69a60eb94eeae068fdeb815305c82f1fda6bb06c Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 10 May 2024 15:06:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=8C=E5=96=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E9=97=AE=E9=A2=98=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interactive/service/impl/InteractiveServiceImpl.java | 9 +++++---- .../java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java index aee1bda..0ac3ff3 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java @@ -13,6 +13,7 @@ import com.hnac.hzims.bigmodel.interactive.service.IInteractiveService; import com.hnac.hzims.bigmodel.interactive.service.IJumpPageService; import com.hnac.hzims.bigmodel.interactive.service.IParamsService; import com.hnac.hzims.bigmodel.interactive.vo.AnswerVO; +import com.xxl.job.core.log.XxlJobLogger; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.log.exception.ServiceException; @@ -170,15 +171,15 @@ public class InteractiveServiceImpl implements IInteractiveService { Assert.isTrue(response.getStatus() == HttpServletResponse.SC_OK, () -> { throw new ServiceException("远程调用大模型【获取问题答案】接口失败!"); }); - + XxlJobLogger.log("接收到答案:"+JSON.toJSONString(response.body())); List result = JSONArray.parseArray(response.body(), AnswerVO.class); result.stream().filter(answerVO -> answerVO.getRunning() == 0).forEach(answerVO -> { - Object[] extras = answerVO.getExtra(); - if(ObjectUtil.isEmpty(answerVO.getExtra()) || extras.length == 0){ + Object[] extras = answerVO.getExtras(); + if(ObjectUtil.isEmpty(answerVO.getExtras()) || extras.length == 0){ return; } List extraList = Arrays.stream(extras).map(Object::toString).map(extraResolveStrategyService::resolve).map(JSON::toJSONString).collect(Collectors.toList()); - answerVO.setExtra(extraList.toArray(new String[extraList.size()])); + answerVO.setExtras(extraList.toArray(new String[extraList.size()])); }); return result; } 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 ec2760d..712b2bf 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 @@ -45,6 +45,6 @@ public class AnswerVO implements Serializable { private String answer; @ApiModelProperty("其它调用的参数") - private Object[] extra; + private Object[] extras; }