发红包优化
This commit is contained in:
@@ -29,9 +29,9 @@ public class RedPacketController {
|
||||
@PostMapping("/send")
|
||||
public R<RedPacket> sendRp(@RequestBody SendRpDTO dto) {
|
||||
Long userId = UserContext.getUserId();
|
||||
// roundId从当前group的进行中局获取
|
||||
var ongoingRound = gameService.getOngoingRound(dto.getGroupId());
|
||||
Long roundId = ongoingRound == null ? null : ongoingRound.getId();
|
||||
// roundId从当前group的RP_SENDING状态局获取
|
||||
var sendingRound = gameService.getRpSendingRound(dto.getGroupId());
|
||||
Long roundId = sendingRound == null ? null : sendingRound.getId();
|
||||
var rp = redPacketService.sendRp(userId, dto.getGroupId(),
|
||||
dto.getTotalAmount(), dto.getTotalCount(), roundId);
|
||||
return R.ok(rp);
|
||||
|
||||
Reference in New Issue
Block a user