package com.sonic.frog.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sonic.frog.domain.entity.AiUser;
import com.sonic.frog.domain.input.AgeRange;
import com.sonic.frog.domain.input.ClassificationListInput;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * AI用户表数据库访问层
 */
@Mapper
public interface AiUserDao extends BaseMapper<AiUser> {


    /**
     * 随机获取AI列表
     *
     * @param currentUserId
     * @param exAiIdList
     * @param count
     * @return
     */
    List<Long> randomGetAiUser(@Param("currentUserId") Long currentUserId,
                               @Param("exAiIdList") List<Long> exAiIdList,
                               @Param("roleCodeList") List<String> roleCodeList,
                               @Param("isRandom") boolean isRandom,
                               @Param("count") Integer count,
                               @Param("sexList") List<Integer> sexList,
                               @Param("ageRangeList") List<AgeRange> ageRangeList
    );

    /**
     * 根据被喜欢数范围获取AI列表
     *
     * @param input
     * @param minLiked
     * @param maxLiked
     * @param limit
     * @return
     */
    List<Long> queryAiIdsByLikedRange(@Param("input") ClassificationListInput input,
                                      @Param("minLiked") int minLiked,
                                      @Param("maxLiked") int maxLiked,
                                      @Param("limit") int limit);

    List<Long> homeRecommend(@Param("lastChatTimeIsNull") Boolean lastChatTimeIsNull, @Param("count") Integer count);
}