【增加】查询对话 message 列表

This commit is contained in:
cherishsince 2024-05-07 11:01:20 +08:00
parent 7fae5c0a7d
commit c124681c3a

View File

@ -18,25 +18,16 @@ import java.util.List;
@Mapper
public interface AiChatMessageMapper extends BaseMapperX<AiChatMessageDO> {
/**
* 删除 - 根据 Conversation id
*
* @param chatConversationId
* @param id
*/
default int deleteByConversationAndId(Long chatConversationId, Long id) {
return this.delete(new LambdaQueryWrapperX<AiChatMessageDO>()
.eq(AiChatMessageDO::getConversationId, chatConversationId)
.eq(AiChatMessageDO::getId, id)
);
}
/**
* 查询 - 根据 对话id查询
*
* @param conversationId
*/
default List<AiChatMessageDO> selectByConversationId(Long conversationId) {
return selectList()
return this.selectList(
new LambdaQueryWrapperX<AiChatMessageDO>()
.eq(AiChatMessageDO::getConversationId, conversationId)
.orderByAsc(AiChatMessageDO::getId)
);
}
}