动态保存消息处理

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.common.gift.GameLuckyGiftCommon;
import com.red.circle.other.app.dto.clientobject.game.GameRoomPkUserCO; 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.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.service.SpinsUserTaskProgressService;
import com.red.circle.other.app.util.DateTimeAsiaRiyadhUtils; import com.red.circle.other.app.util.DateTimeAsiaRiyadhUtils;
import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.domain.gateway.user.UserProfileGateway;
@ -736,7 +737,7 @@ public class GiftCountStrategy implements GiftStrategy {
// 验证动态是否存在 // 验证动态是否存在
DynamicContent dynamicContent = DynamicContent dynamicContent =
dynamicContentService.getById(runningWater.getDynamicContentId()); dynamicContentService.getById(runningWater.getDynamicContentId());
if (dynamicContent == null || Boolean.TRUE.equals(dynamicContent.getDel())) { if (dynamicContent == null || Boolean.TRUE.equals(dynamicContent.getDel())) {
log.warn("动态不存在或已删除, dynamicContentId={}", runningWater.getDynamicContentId()); log.warn("动态不存在或已删除, dynamicContentId={}", runningWater.getDynamicContentId());
return; return;
@ -762,16 +763,24 @@ public class GiftCountStrategy implements GiftStrategy {
giftValue.getUnitPrice() giftValue.getUnitPrice()
); );
dynamicMessageService.save( // 保存消息
runningWater.getGiftId() + " * " + giftValue.getQuantity(), DynamicMessage message = new DynamicMessage();
Long.parseLong(runningWater.getDynamicContentId()), message.setDynamicContentId(Long.parseLong(runningWater.getDynamicContentId()));
dynamicContent.getCreateUser(), message.setToUserId( dynamicContent.getCreateUser());
DynamicMessageEnum.DYNAMIC_GIFT message.setCreateUser(runningWater.getUserId());
); saveDynamicMessage(message, DynamicMessageEnum.DYNAMIC_GIFT);
} catch (Exception e) { } catch (Exception e) {
log.error("处理动态礼物失败", 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);
}
} }