package com.ym.mec.biz.service;

import com.ym.mec.biz.dal.entity.LuckDrawCount;
import com.ym.mec.common.service.BaseService;

public interface LuckDrawCountService extends BaseService<Long, LuckDrawCount> {

	public LuckDrawCount getLock(Long userId);

	/**
	 * 免费赠送次数
	 * @param userId
	 * @param times
	 * @return
	 */
	public boolean freeGive(Long userId, int times,Integer groupId);

	/**
	 * 更新抽奖次数
	 * @param userId
	 * @param times
	 * @return
	 */
	public boolean updateTimes(Long userId, int times);

	/**
	 * 更新抽奖金额
	 * @param userId
	 * @param amount 以分为单位
	 * @return
	 */
	public boolean updateAmount(Long userId, Long amount);

	/**
	* @description:
	 * @param userId
	 * @param groupId
	* @return com.ym.mec.biz.dal.entity.LuckDrawCount
	* @author zx
	* @date 2021/10/19 16:16
	*/
	LuckDrawCount findByIdAndGroupId(Integer userId, int groupId);

	/**
	* @description:
	 * @param userId
	 * @param groupId
	* @return com.ym.mec.biz.dal.entity.LuckDrawCount
	* @author zx
	* @date 2021/10/19 16:16
	*/
	LuckDrawCount findLockByIdAndGroupId(Integer userId, int groupId);
}
