mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
修复漏洞
--AgentChatHistoryServiceImpl.java 用户聊天记录不一定都带有音频,查询时要排除不带音频的最近50条聊天记录 --AgentChatHistoryService.java 修改方法描述
This commit is contained in:
+2
-2
@@ -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);
|
||||
|
||||
+2
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user