【解决todo】ai 对话改为升序

This commit is contained in:
cherishsince 2024-05-21 10:59:28 +08:00
parent 983742fd74
commit 3633c7415b

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.ai.dal.mysql.chat;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatConversationDO;
import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatMessageDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -16,7 +16,11 @@ import java.util.List;
public interface AiChatConversationMapper extends BaseMapperX<AiChatConversationDO> {
default List<AiChatConversationDO> selectListByUserId(Long userId) {
return selectList(AiChatConversationDO::getUserId, userId);
return selectList(
new LambdaQueryWrapperX<AiChatConversationDO>()
.eq(AiChatConversationDO::getUserId, userId)
.orderByAsc(AiChatConversationDO::getCreateTime)
);
}
}