Commit c124681c3affd61bf9839a266b6bfc7c19cd2d6f
1 parent
7fae5c0a
【增加】查询对话 message 列表
Showing
1 changed file
with
5 additions
and
14 deletions
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/mysql/AiChatMessageMapper.java
| ... | ... | @@ -19,24 +19,15 @@ import java.util.List; |
| 19 | 19 | public interface AiChatMessageMapper extends BaseMapperX<AiChatMessageDO> { |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * 删除 - 根据 Conversation 和 id | |
| 23 | - * | |
| 24 | - * @param chatConversationId | |
| 25 | - * @param id | |
| 26 | - */ | |
| 27 | - default int deleteByConversationAndId(Long chatConversationId, Long id) { | |
| 28 | - return this.delete(new LambdaQueryWrapperX<AiChatMessageDO>() | |
| 29 | - .eq(AiChatMessageDO::getConversationId, chatConversationId) | |
| 30 | - .eq(AiChatMessageDO::getId, id) | |
| 31 | - ); | |
| 32 | - } | |
| 33 | - | |
| 34 | - /** | |
| 35 | 22 | * 查询 - 根据 对话id查询 |
| 36 | 23 | * |
| 37 | 24 | * @param conversationId |
| 38 | 25 | */ |
| 39 | 26 | default List<AiChatMessageDO> selectByConversationId(Long conversationId) { |
| 40 | - return selectList() | |
| 27 | + return this.selectList( | |
| 28 | + new LambdaQueryWrapperX<AiChatMessageDO>() | |
| 29 | + .eq(AiChatMessageDO::getConversationId, conversationId) | |
| 30 | + .orderByAsc(AiChatMessageDO::getId) | |
| 31 | + ); | |
| 41 | 32 | } |
| 42 | 33 | } | ... | ... |