feat(chat): 添加批量获取语义解析信息功能
Some checks failed
supersonic CentOS CI / build (21) (push) Has been cancelled
supersonic mac CI / build (21) (push) Has been cancelled
supersonic ubuntu CI / build (21) (push) Has been cancelled
supersonic windows CI / build (21) (push) Has been cancelled

- 在ChatManageService中新增getParseInfos方法用于批量查询
- 实现ChatManageServiceImpl中的getParseInfos具体逻辑
- 优化SqlReplaceHelper中的代码格式化处理
- 支持根据questionId批量获取多个语义解析结果
This commit is contained in:
jerryjzhang
2026-04-21 14:14:27 +08:00
parent 0bbab5e7b1
commit aa86e3f02a
3 changed files with 13 additions and 1 deletions

View File

@@ -52,4 +52,6 @@ public interface ChatManageService {
List<ChatParseDO> batchAddParse(ChatParseReq chatParseReq, ChatParseResp chatParseResp);
SemanticParseInfo getParseInfo(Long questionId, int parseId);
List<SemanticParseInfo> getParseInfos(Long questionId);
}

View File

@@ -244,4 +244,13 @@ public class ChatManageServiceImpl implements ChatManageService {
return JSONObject.parseObject(chatParseDO.getParseInfo(), SemanticParseInfo.class);
}
}
@Override
public List<SemanticParseInfo> getParseInfos(Long questionId) {
List<ChatParseDO> chatParseDOs =
chatQueryRepository.getParseInfoList(Collections.singletonList(questionId));
return chatParseDOs.stream().map(chatParseDO -> JSONObject
.parseObject(chatParseDO.getParseInfo(), SemanticParseInfo.class))
.collect(Collectors.toList());
}
}