package com.yeshi.fanli.service.inter.redpack;
|
|
import java.math.BigDecimal;
|
import java.util.List;
|
|
import com.yeshi.fanli.entity.redpack.RedPackBalance;
|
import com.yeshi.fanli.entity.redpack.RedPackDetail;
|
import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
|
import com.yeshi.fanli.vo.redpack.RedPackBalanceVO;
|
|
public interface RedPackBalanceService {
|
|
/**
|
* 查询用户余额信息
|
* @param uid
|
* @return
|
*/
|
public RedPackBalance selectByPrimaryKey(Long uid);
|
|
/**
|
* 获取用户余额
|
* @param uid
|
* @return
|
*/
|
public BigDecimal getBalance(Long uid);
|
|
|
/**
|
* 添加红包
|
* @param uid
|
* @param money
|
*/
|
public void addRedPack(Long uid, BigDecimal money, RedPackDetail detail) throws RedPackBalanceException;
|
|
/**
|
* 减少红包
|
* @param uid
|
* @param money
|
*/
|
public void subRedPack(Long uid, BigDecimal money, RedPackDetail detail) throws RedPackBalanceException;
|
|
/**
|
* 后端查询列表
|
* @param start
|
* @param count
|
* @param key
|
* @param state
|
* @param order
|
* @return
|
*/
|
public List<RedPackBalanceVO> query(Integer start, Integer count, String key, Integer state, Integer order);
|
|
public long count(String key, Integer state);
|
|
/**
|
* 重置红包
|
* @param uid
|
* @param detail
|
* @throws RedPackBalanceException
|
*/
|
public void resetRedPack(Long uid, RedPackDetail detail) throws RedPackBalanceException;
|
|
/**
|
* 查询用于更新 + 枷锁
|
* @param uid
|
* @return
|
*/
|
public RedPackBalance selectForUpdate(Long uid);
|
}
|