package com.sonic.frog.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sonic.frog.domain.bo.AIUserAlbumGroupBo;
import com.sonic.frog.domain.entity.AiUserAlbum;
import com.sonic.frog.lib.output.AIUserAlbumApiOutput;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * AI用户相册数据访问接口
 */
@Mapper
public interface AiUserAlbumDao extends BaseMapper<AiUserAlbum> {
    /**
     * 增加点赞数
     *
     * @param id
     * @param count
     */
    void incrementLikedCount(@Param("id") Long id, @Param("count") int count);

    /**
     * 分页查询AI用户相册
     *
     * @param objectPage
     * @param aiId
     * @param unlockAlbumIds
     * @return
     */
    IPage<AiUserAlbum> listAlbumsPage(Page<AiUserAlbum> objectPage, @Param("aiId") Long aiId, @Param("unlockAlbumIds") List<Long> unlockAlbumIds);

    /**
     * 根据用户查询数据并分组
     * @param aiIdList
     * @return
     */
    List<AIUserAlbumGroupBo> listAlbumsGroup(@Param("aiIdList") List<Long> aiIdList);

    /**
     * 获取待解锁图片
     * @param userId
     * @param aiId
     * @return
     */
    List<AIUserAlbumApiOutput> getRandomLockImage(@Param("userId") Long userId, @Param("aiId") Long aiId);
}