package com.yonge.cooleshow.biz.dal.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
import com.yonge.cooleshow.biz.dal.queryInfo.UserRewardQueryInfo;
import com.yonge.cooleshow.biz.dal.vo.ActivityUserRewardVo;
import com.yonge.cooleshow.biz.dal.dto.search.ActivityUserRewardSearch;
import com.yonge.cooleshow.biz.dal.entity.ActivityUserReward;
import com.yonge.cooleshow.biz.dal.vo.UserRewardVo;
import com.yonge.cooleshow.biz.dal.vo.activity.UserRewardWrapper;

/**
 * 活动用户获奖表 服务类
 * @author liweifan
 * @date 2022-08-04
 */
public interface ActivityUserRewardService extends IService<ActivityUserReward>  {

	/**
     * 查询详情
     * @author liweifan
 	 * @date 2022-08-04
     */
	ActivityUserRewardVo detail(Long id);

    /**
     * 分页查询
     * @author liweifan
 	 * @date 2022-08-04
     */
    IPage<UserRewardVo> selectPage(IPage<UserRewardVo> page, ActivityUserRewardSearch query);

	/**
	 * 订单购买的发奖记录
	 *
	 * @param activityId 活动id
	 * @param rewardId 奖品id
	 * @param userId 用户id
	 */
    void saveRewardRecord(Long activityId, Long rewardId, Long userId);

	/**
	 * 检查是否存在未领取的奖品
	 *
	 * @param userId 用户id
	 * @param client 客户端
	 * @return
	 */
    Boolean checkReceiveReward(Long userId, ClientEnum client);

	/**
	 * 领奖
	 *
	 */
	Boolean receiveReward(Long userId, Long receiveRewardId);

	/**
	 * 发放奖品记录
	 */
	IPage<UserRewardWrapper> receiveRewardList(IPage<UserRewardWrapper> page, UserRewardQueryInfo query);
}