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.auth.api.entity.SysUser;
import com.yonge.cooleshow.biz.dal.dto.ActivityPlanDto;
import com.yonge.cooleshow.biz.dal.dto.SaveOrUpdateRewardDto;
import com.yonge.cooleshow.biz.dal.dto.req.OrderReq;
import com.yonge.cooleshow.biz.dal.dto.search.ActivityPlanSearch;
import com.yonge.cooleshow.biz.dal.entity.ActivityPlan;
import com.yonge.cooleshow.biz.dal.vo.ActivityPlanVo;
import com.yonge.cooleshow.biz.dal.vo.MusicActivityVo;
import com.yonge.cooleshow.biz.dal.vo.UserOrderDetailVo;
import com.yonge.cooleshow.biz.dal.vo.res.OrderCreateRes;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import com.yonge.cooleshow.common.enums.ActivityShareEnum;
import com.yonge.cooleshow.common.enums.YesOrNoEnum;

/**
 * 活动计划表 服务类
 * @author liweifan
 * @date 2022-08-04
 */
public interface ActivityPlanService extends IService<ActivityPlan>  {

	/**
     * 查询详情
     * @author liweifan
 	 * @date 2022-08-04
     */
	ActivityPlanVo detail(Long id);
    /**
     * 分页查询
     * @author liweifan
 	 * @date 2022-08-04
     */
    IPage<ActivityPlanVo> selectPage(IPage<ActivityPlanVo> page, ActivityPlanSearch query);
	/**
	 * 新增活动
	 * @param activityPlan
	 * @return
	 */
	ActivityPlan submit(ActivityPlanDto activityPlan);

	Boolean updateActivityState(Long activityId, Integer activityState, Long id);

	Boolean updateDraftFlag(Long activityId, Integer draftFlag, Long id);

	/**
	 * 活动信息
	 *
	 * @param activityPlanId 活动id
	 * @param user 用户
	 * @return
	 */
    MusicActivityVo getActivityInfo(Long activityPlanId, SysUser user);

	/**
	 * 活动报名下单验证
	 *
	 * @param orderReqInfo
	 * @return
	 */
    HttpResponseResult<OrderCreateRes> orderCreate(OrderReq.OrderReqInfo orderReqInfo);

	/**
	 * 活动购买
	 *
	 * @param userOrderDetailVo
	 */
    void orderSuccess(UserOrderDetailVo userOrderDetailVo);

	/**
	 * 参与活动项目
	 *
	 * @param evaluationId 活动项目id
	 * @param user 用户
	 * @return
	 */
	Boolean joinEvaluation(Long evaluationId, SysUser user);

	/**
	 * 活动报名
	 *
	 * @param activityId 活动id
	 * @param user 用户
	 * @return
	 */
    Boolean joinActivity(Long activityId, SysUser user);

	/**
	 * 定时变更活动状态
	 */
    void activityState();
	/**
	 * 活动中定时轮询
	 */
	void activityIng();

	/**
	 * 变更活动奖品
	 *
	 * @param saveOrUpdateRewardDto
	 * @return
	 */
    Boolean saveOrUpdateReward(SaveOrUpdateRewardDto saveOrUpdateRewardDto);


	/**
	 * 活动分享
	 * @param type 分享类型
	 * @param userId 用户id
	 * @return
	 */
	ActivityPlanVo activityShare(ActivityShareEnum type, Long userId);

	/**
	 * 检查活动是否进行中
	 *
	 * @param activityId 活动id
	 * @return
	 */
	YesOrNoEnum state(Long activityId);
}