发红包优化

This commit is contained in:
wells
2026-08-08 22:22:48 +08:00
parent cfb5b4f2a8
commit b227f33d9f
4 changed files with 71 additions and 13 deletions
@@ -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);