Skip to content

Commit 409a4cd

Browse files
committed
命名
1 parent 80cdf29 commit 409a4cd

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/main/java/com/crossoverjie/red/RedPacket.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ public class RedPacket {
1515
/**
1616
* 生成红包最小值 1分
1717
*/
18-
private static final int MINMONEY = 1 ;
18+
private static final int MIN_MONEY = 1 ;
1919

2020
/**
2121
* 生成红包最大值 200人民币
2222
*/
23-
private static final int MAXMONEY = 200 * 100 ;
23+
private static final int MAX_MONEY = 200 * 100 ;
2424

2525
/**
2626
* 小于最小值
@@ -48,11 +48,11 @@ private List<Integer> splitRedPacket(int money,int count){
4848

4949
//计算出最大红包
5050
int max = (int) ((money / count) * TIMES) ;
51-
max = max > MAXMONEY ? MAXMONEY : max ;
51+
max = max > MAX_MONEY ? MAX_MONEY : max ;
5252

5353
for (int i = 0 ; i< count ; i++){
5454
//随机获取红包
55-
int redPacket = randomRedPacket(money,MINMONEY,max,count - i) ;
55+
int redPacket = randomRedPacket(money, MIN_MONEY,max,count - i) ;
5656
moneys.add(redPacket);
5757
//总金额每次减少
5858
money -= redPacket ;
@@ -110,11 +110,11 @@ private int randomRedPacket(int totalMoney, int minMoney, int maxMoney, int coun
110110
*/
111111
private int checkMoney(int lastMoney, int count) {
112112
double avg = lastMoney / count ;
113-
if (avg < MINMONEY){
113+
if (avg < MIN_MONEY){
114114
return LESS ;
115115
}
116116

117-
if (avg > MAXMONEY){
117+
if (avg > MAX_MONEY){
118118
return MORE ;
119119
}
120120

0 commit comments

Comments
 (0)