修复漏洞

--AgentChatHistoryServiceImpl.java 用户聊天记录不一定都带有音频,查询时要排除不带音频的最近50条聊天记录
--AgentChatHistoryService.java 修改方法描述
This commit is contained in:
JianYu Zheng
2025-07-08 17:32:44 +08:00
parent 53cfdcc240
commit 3ed13b3ff5
2 changed files with 4 additions and 3 deletions
@@ -47,9 +47,9 @@ public interface AgentChatHistoryService extends IService<AgentChatHistoryEntity
void deleteByAgentId(String agentId, Boolean deleteAudio, Boolean deleteText);
/**
* 根据智能体ID获取最近50条用户的聊天记录数据
* 根据智能体ID获取最近50条用户的聊天记录数据(带音频数据)
*
* @param agentId 查询参数,包含agentId、page、limit
* @param agentId 智能体id
* @return 聊天记录列表(只有用户)
*/
List<AgentChatHistoryUserVO> getRecentlyFiftyByAgentId(String agentId);
@@ -101,7 +101,8 @@ public class AgentChatHistoryServiceImpl extends ServiceImpl<AiAgentChatHistoryD
LambdaQueryWrapper<AgentChatHistoryEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.select(AgentChatHistoryEntity::getContent,AgentChatHistoryEntity::getAudioId)
.eq(AgentChatHistoryEntity::getAgentId, agentId)
.eq(AgentChatHistoryEntity::getChatType, AgentChatHistoryType.USER.getValue());
.eq(AgentChatHistoryEntity::getChatType, AgentChatHistoryType.USER.getValue())
.isNotNull(AgentChatHistoryEntity::getAudioId);
// 构建分页查询,查询前50页数据
Page<AgentChatHistoryEntity> pageParam = new Page<>(0, 50);