动态保存消息处理

This commit is contained in:
tianfeng 2026-02-02 14:48:41 +08:00
parent b1cbd6b81f
commit ee59f6f25e

View File

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