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