Skip to content

Commit

Permalink
fix: fix gpt interface error (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangsiyuan-code authored Jan 16, 2024
1 parent 4eea04c commit b97d555
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ public String submit(Map<String, Object> request, String traceId) {
public String save(List<Map<String, Object>> 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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public void doManage() {
@PostMapping("/qa/save")
@ResponseBody
@MonitorScopeAuth(targetType = AuthTargetType.TENANT, needPower = PowerConstants.EDIT)
public JsonResult<Map<String, Object>> qaSave(@RequestBody List<Map<String, Object>> request) {
final JsonResult<Map<String, Object>> result = new JsonResult<>();
public JsonResult<String> qaSave(@RequestBody List<Map<String, Object>> request) {
final JsonResult<String> result = new JsonResult<>();
facadeTemplate.manage(result, new ManageCallback() {
@Override
public void checkParameter() {
Expand All @@ -160,8 +160,7 @@ public void checkParameter() {
@Override
public void doManage() {
String str = gptService.save(request, UUID.randomUUID().toString());
Map<String, Object> rtnMap = J.toMap(str);
JsonResult.createSuccessResult(result, rtnMap);
JsonResult.createSuccessResult(result, str);
}
});

Expand Down

0 comments on commit b97d555

Please sign in to comment.