From b97d5558a09bc8ef298bb746ca5cb0265514e504 Mon Sep 17 00:00:00 2001 From: wangsiyuan-code <61226922+wangsiyuan-code@users.noreply.github.com> Date: Tue, 16 Jan 2024 20:25:48 +0800 Subject: [PATCH] fix: fix gpt interface error (#779) --- .../server/home/biz/service/gpt/GptService.java | 7 ++++--- .../server/home/web/controller/GPTFacadeImpl.java | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/gpt/GptService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/gpt/GptService.java index 64f7a6dbf..0eb701b39 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/gpt/GptService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/gpt/GptService.java @@ -45,9 +45,10 @@ public String submit(Map request, String traceId) { public String save(List> request, String traceId) { String saveUrl = environmentProperties.getGptUrl() + "/qa/save"; if (CollectionUtils.isNotEmpty(request)) { - LOGGER.info("{} [submit],url={},requestBody={}", traceId, saveUrl, - JSON.toJSONString(request)); - request.forEach(req -> post(saveUrl, JSON.toJSONString(req), traceId)); + request.forEach(req -> { + LOGGER.info("{} [save],url={},requestBody={}", traceId, saveUrl, JSON.toJSONString(req)); + post(saveUrl, JSON.toJSONString(req), traceId); + }); return "SUCCESS"; } else { return "FALSE"; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/GPTFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/GPTFacadeImpl.java index bda7c8eeb..f7162badc 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/GPTFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/GPTFacadeImpl.java @@ -149,8 +149,8 @@ public void doManage() { @PostMapping("/qa/save") @ResponseBody @MonitorScopeAuth(targetType = AuthTargetType.TENANT, needPower = PowerConstants.EDIT) - public JsonResult> qaSave(@RequestBody List> request) { - final JsonResult> result = new JsonResult<>(); + public JsonResult qaSave(@RequestBody List> request) { + final JsonResult result = new JsonResult<>(); facadeTemplate.manage(result, new ManageCallback() { @Override public void checkParameter() { @@ -160,8 +160,7 @@ public void checkParameter() { @Override public void doManage() { String str = gptService.save(request, UUID.randomUUID().toString()); - Map rtnMap = J.toMap(str); - JsonResult.createSuccessResult(result, rtnMap); + JsonResult.createSuccessResult(result, str); } });