KKSU
2024-07-12 b312d39efd2d683be6647ebc72d609a9d58e7868
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
package cc.mrbird.febs.dapp.enumerate;
 
/**
 * 卡牌分期
 */
public enum CardPeriod {
 
    ONE(0,1000, 6),
    TWO(1001,1500, 9),
    THREE(2501,1500, 12);
 
    private int min;
 
    private int cardCnt;
 
    private int recommendCnt;
 
 
 
    CardPeriod(int min, int cardCnt, int recommendCnt) {
        this.min = min;
        this.cardCnt = cardCnt;
        this.recommendCnt = recommendCnt;
    }
 
    public int recommendCnt(int totalSupply) {
        for (CardPeriod value : CardPeriod.values()) {
            if (value.min <= totalSupply && totalSupply < (value.min + value.cardCnt)) {
                return value.recommendCnt;
            }
        }
 
        return 0;
    }
 
}