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; } }