mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-22 23:14:33 +08:00
feat(chat): 添加批量获取语义解析信息功能
- 在ChatManageService中新增getParseInfos方法用于批量查询 - 实现ChatManageServiceImpl中的getParseInfos具体逻辑 - 优化SqlReplaceHelper中的代码格式化处理 - 支持根据questionId批量获取多个语义解析结果
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user