fix(service): 调整AI聊天消息排序为倒序
This commit is contained in:
@@ -46,8 +46,8 @@ public class KeyboardAiChatMessageServiceImpl extends ServiceImpl<KeyboardAiChat
|
|||||||
queryWrapper.eq(KeyboardAiChatMessage::getUserId, userId)
|
queryWrapper.eq(KeyboardAiChatMessage::getUserId, userId)
|
||||||
.eq(KeyboardAiChatMessage::getCompanionId, companionId)
|
.eq(KeyboardAiChatMessage::getCompanionId, companionId)
|
||||||
.eq(KeyboardAiChatMessage::getSessionId, activeSession.getId())
|
.eq(KeyboardAiChatMessage::getSessionId, activeSession.getId())
|
||||||
.orderByAsc(KeyboardAiChatMessage::getCreatedAt)
|
.orderByDesc(KeyboardAiChatMessage::getCreatedAt)
|
||||||
.orderByAsc(KeyboardAiChatMessage::getId);
|
.orderByDesc(KeyboardAiChatMessage::getId);
|
||||||
IPage<KeyboardAiChatMessage> entityPage = this.page(page, queryWrapper);
|
IPage<KeyboardAiChatMessage> entityPage = this.page(page, queryWrapper);
|
||||||
return entityPage.convert(entity -> BeanUtil.copyProperties(entity, ChatMessageHistoryVO.class));
|
return entityPage.convert(entity -> BeanUtil.copyProperties(entity, ChatMessageHistoryVO.class));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user