123
This commit is contained in:
@@ -49,6 +49,7 @@ public class ConsumeController {
|
|||||||
@Operation(summary = "赠送主播礼物")
|
@Operation(summary = "赠送主播礼物")
|
||||||
@Log(title = "赠送主播礼物", businessType = BusinessType.OTHER, isSaveDb = true)
|
@Log(title = "赠送主播礼物", businessType = BusinessType.OTHER, isSaveDb = true)
|
||||||
public R<Void> giveGift(@RequestBody GiveGiftReq query){
|
public R<Void> giveGift(@RequestBody GiveGiftReq query){
|
||||||
|
query.setFromUserId(LoginHelper.getUserId());
|
||||||
GiftConsumerResp resp = consumerManager.sendGift(query);
|
GiftConsumerResp resp = consumerManager.sendGift(query);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ public class GiveGiftReq {
|
|||||||
@Schema(description = "类型 1 个人详情页 2.IM页面 3视频页")
|
@Schema(description = "类型 1 个人详情页 2.IM页面 3视频页")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(hidden = true)
|
||||||
|
private Long fromUserId;
|
||||||
|
|
||||||
@Schema(description = "接收方用户ID")
|
@Schema(description = "接收方用户ID")
|
||||||
private Long toUserId;
|
private Long toUserId;
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class UserGiftServiceImpl extends ServiceImpl<UserGiftMapper, UserGift> i
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public GiftConsumerResp giveGift(GiveGiftReq query) {
|
public GiftConsumerResp giveGift(GiveGiftReq query) {
|
||||||
Long fromUserId = LoginHelper.getUserId();
|
Long fromUserId = query.getFromUserId();
|
||||||
Gift gift = giftService.getById(query.getGiftId());
|
Gift gift = giftService.getById(query.getGiftId());
|
||||||
if(gift == null){
|
if(gift == null){
|
||||||
throw new ServiceException("礼物不存在");
|
throw new ServiceException("礼物不存在");
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ public class GiftMessageHandler extends AbstractMessageHandle implements IMessag
|
|||||||
}
|
}
|
||||||
GiveGiftReq giveGiftReq = new GiveGiftReq();
|
GiveGiftReq giveGiftReq = new GiveGiftReq();
|
||||||
giveGiftReq.setType(3);
|
giveGiftReq.setType(3);
|
||||||
|
giveGiftReq.setFromUserId(fdCtxData.getUserId());
|
||||||
giveGiftReq.setToUserId(fdCtxData.getTarUserId());
|
giveGiftReq.setToUserId(fdCtxData.getTarUserId());
|
||||||
giveGiftReq.setGiftId(giftId);
|
giveGiftReq.setGiftId(giftId);
|
||||||
giveGiftReq.setGiftCount(giftCount);
|
giveGiftReq.setGiftCount(giftCount);
|
||||||
|
|||||||
Reference in New Issue
Block a user