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); + } + + }