是否手动领取 领取限制问题
This commit is contained in:
parent
91b876367e
commit
1ca118c07b
@ -48,6 +48,7 @@ public class RocketRestController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/claim")
|
@PostMapping("/claim")
|
||||||
public RocketRewardCO claimReward(@Valid @RequestBody RocketRewardClaimCmd cmd) {
|
public RocketRewardCO claimReward(@Valid @RequestBody RocketRewardClaimCmd cmd) {
|
||||||
|
cmd.setReceive(true);
|
||||||
return rocketService.claimReward(cmd);
|
return rocketService.claimReward(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -142,7 +142,7 @@ public class RocketRewardClaimCmdExe {
|
|||||||
// 4. 检查库存(查询,不递增)
|
// 4. 检查库存(查询,不递增)
|
||||||
int rewardQuantity = config.getRewardQuantity() != null ? config.getRewardQuantity() : 20;
|
int rewardQuantity = config.getRewardQuantity() != null ? config.getRewardQuantity() : 20;
|
||||||
int currentClaimed = latestHistory.getClaimedCount() != null ? latestHistory.getClaimedCount() : 0;
|
int currentClaimed = latestHistory.getClaimedCount() != null ? latestHistory.getClaimedCount() : 0;
|
||||||
if (currentClaimed >= rewardQuantity) {
|
if (Boolean.TRUE.equals(cmd.getReceive()) && currentClaimed >= rewardQuantity) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,4 +22,9 @@ public class RocketRewardClaimCmd extends AppExtCommand {
|
|||||||
@NotNull(message = "房间ID不能为空")
|
@NotNull(message = "房间ID不能为空")
|
||||||
private Long roomId;
|
private Long roomId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否手动领取
|
||||||
|
*/
|
||||||
|
private Boolean receive;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user