From ee59f6f25e34c98b011118433aac677b497cf39c Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 2 Feb 2026 14:48:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=BF=9D=E5=AD=98=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gift/strategy/GiftCountStrategy.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java index 85fe912a..201f880a 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java @@ -17,6 +17,7 @@ import com.red.circle.other.app.common.game.GameIndoorTeamPkCommon; import com.red.circle.other.app.common.gift.GameLuckyGiftCommon; import com.red.circle.other.app.dto.clientobject.game.GameRoomPkUserCO; import com.red.circle.other.app.dto.cmd.SpinsTaskProgressUpdateCmd; +import com.red.circle.other.app.dto.cmd.dynamic.DynamicLikeCmd; import com.red.circle.other.app.service.SpinsUserTaskProgressService; import com.red.circle.other.app.util.DateTimeAsiaRiyadhUtils; import com.red.circle.other.domain.gateway.user.UserProfileGateway; @@ -736,7 +737,7 @@ public class GiftCountStrategy implements GiftStrategy { // 验证动态是否存在 DynamicContent dynamicContent = dynamicContentService.getById(runningWater.getDynamicContentId()); - + if (dynamicContent == null || Boolean.TRUE.equals(dynamicContent.getDel())) { log.warn("动态不存在或已删除, dynamicContentId={}", runningWater.getDynamicContentId()); return; @@ -762,16 +763,24 @@ public class GiftCountStrategy implements GiftStrategy { giftValue.getUnitPrice() ); - dynamicMessageService.save( - runningWater.getGiftId() + " * " + giftValue.getQuantity(), - Long.parseLong(runningWater.getDynamicContentId()), - dynamicContent.getCreateUser(), - DynamicMessageEnum.DYNAMIC_GIFT - ); + // 保存消息 + DynamicMessage message = new DynamicMessage(); + message.setDynamicContentId(Long.parseLong(runningWater.getDynamicContentId())); + message.setToUserId( dynamicContent.getCreateUser()); + message.setCreateUser(runningWater.getUserId()); + saveDynamicMessage(message, DynamicMessageEnum.DYNAMIC_GIFT); } catch (Exception e) { log.error("处理动态礼物失败", e); } } + private void saveDynamicMessage(DynamicMessage message, DynamicMessageEnum type) { + message.setId(IdWorkerUtils.getId()); + message.setType(type.name()); + message.setCreateTime(TimestampUtils.now()); + dynamicMessageService.save(message); + } + + }