admin
2020-02-23 b59fef5c00b15fdfdfa9d4be26e5bf6b41c75458
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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);
}