This commit is contained in:
wells
2026-08-05 15:08:42 +08:00
parent 45e8e3d637
commit e6637012d6
9 changed files with 86 additions and 56 deletions
@@ -2,6 +2,8 @@ package com.tailbet.controller;
import com.tailbet.model.dto.ReceiveRpDTO;
import com.tailbet.model.dto.SendRpDTO;
import com.tailbet.model.entity.RedPacket;
import com.tailbet.model.entity.RedPacketRecv;
import com.tailbet.model.vo.R;
import com.tailbet.model.vo.UserContext;
import com.tailbet.service.IRedPacketService;
@@ -22,7 +24,7 @@ public class RedPacketController {
* 发红包
*/
@PostMapping("/send")
public R<?> sendRp(@RequestBody SendRpDTO dto) {
public R<RedPacket> sendRp(@RequestBody SendRpDTO dto) {
try {
Long userId = UserContext.getUserId();
var rp = redPacketService.sendRp(userId, dto.getGroupId(),
@@ -37,7 +39,7 @@ public class RedPacketController {
* 领红包
*/
@PostMapping("/receive")
public R<?> receiveRp(@RequestBody ReceiveRpDTO dto) {
public R<RedPacketRecv> receiveRp(@RequestBody ReceiveRpDTO dto) {
try {
Long userId = UserContext.getUserId();
var recv = redPacketService.receiveRp(dto.getRpId(), userId);
@@ -51,8 +53,8 @@ public class RedPacketController {
* 获取红包详情
*/
@GetMapping("/detail")
public R<?> detail(Long rpId) {
public R<RedPacket> detail(Long rpId) {
var rp = redPacketService.getById(rpId);
return R.ok(rp);
}
}
}