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.entity.AiUserGift;
import com.sonic.frog.domain.output.AiUserGiftListOutput;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import javax.validation.constraints.NotNull;

/**
 * AI用户收到礼物数据访问接口
 */
@Mapper
public interface AiUserGiftDao extends BaseMapper<AiUserGift> {
    /**
     * 分页获取用户获得的礼物列表
     *
     * @param page
     * @param aiId
     * @return
     */
    IPage<AiUserGiftListOutput> getAiUserGiftList(Page<AiUserGiftListOutput> page, @Param("aiId") Long aiId);

    /**
     * 增加礼物数量
     *
     * @param aiId
     * @param giftId
     * @param num
     */
    void increaseGiftNum(@Param("aiId") Long aiId, @Param("giftId") Long giftId, @Param("num") Integer num);
}