From 9e4c21749b4c2ebb5d8021e22684d71afbd0b395 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Thu, 9 May 2024 15:59:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A7=A3=E6=9E=90=E5=A4=A7=E6=A8=A1?= =?UTF-8?q?=E5=9E=8Bextra=20bug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/bigmodel/interactive/constants/FunctionConstants.java | 2 ++ .../bigmodel/interactive/service/impl/InteractiveServiceImpl.java | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FunctionConstants.java b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FunctionConstants.java index 958e3ba..5a509dc 100644 --- a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FunctionConstants.java +++ b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FunctionConstants.java @@ -16,7 +16,9 @@ public interface FunctionConstants { enum TypeEnum { /**跳转页面**/ JUMP("1"), + /**链接**/ LINK("2"), + /**参数**/ PARAMS("3") ; @Getter 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 1222533..1914df5 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 @@ -137,7 +137,9 @@ public class InteractiveServiceImpl implements IInteractiveService { Assert.isTrue(response.getStatus() == HttpServletResponse.SC_OK, () -> { throw new ServiceException("远程调用大模型【获取问题答案】接口失败!"); }); - JSONArray.parseArray(response.body(),AnswerVO.class).forEach(answerVO -> { + + List result = JSONArray.parseArray(response.body(), AnswerVO.class); + result.stream().filter(answerVO -> answerVO.getRunning() == 0).forEach(answerVO -> { String[] extras = answerVO.getExtra(); if(ObjectUtil.isEmpty(answerVO.getExtra()) || extras.length == 0){ return; @@ -145,7 +147,7 @@ public class InteractiveServiceImpl implements IInteractiveService { List extraList = Arrays.stream(extras).map(extraResolveStrategyService::resolve).map(JSON::toJSONString).collect(Collectors.toList()); answerVO.setExtra(extraList.toArray(new String[extraList.size()])); }); - return JSONArray.parseArray(response.body(),AnswerVO.class); + return result; } @Override