diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/config/EnumConfigKey.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/config/EnumConfigKey.java index d87fb553..393dd17a 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/config/EnumConfigKey.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/config/EnumConfigKey.java @@ -385,7 +385,14 @@ public enum EnumConfigKey { /** * 设备注册白名单 */ - DEVICE_REGISTER_WHITELIST; + DEVICE_REGISTER_WHITELIST, + + /** + * 火箭房间 + */ + ROCKET_ROOM_LIST, + + ; public String concatSysOrigin(SysOriginPlatformEnum sysOrigin) { diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketStatusQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketStatusQryExe.java index e20a2ebf..ac1bbb42 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketStatusQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketStatusQryExe.java @@ -89,7 +89,7 @@ public class RocketStatusQryExe { */ private RocketStatusCO buildInitialStatus(Long roomId) { RocketStatusCO statusCO = new RocketStatusCO(); - statusCO.setRoomId(roomId); + statusCO.setRoomId(String.valueOf(roomId)); statusCO.setDate(LocalDate.now().toString()); statusCO.setLevel(1); statusCO.setLevelName("一级火箭"); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/RocketConvertor.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/RocketConvertor.java index 7e89edae..4ebdb414 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/RocketConvertor.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/RocketConvertor.java @@ -28,7 +28,7 @@ public class RocketConvertor { } RocketStatusCO co = new RocketStatusCO(); - co.setRoomId(rocketStatus.getRoomId()); + co.setRoomId(String.valueOf(rocketStatus.getRoomId())); co.setDate(rocketStatus.getDate()); co.setLevel(rocketStatus.getLevel().getLevel()); co.setLevelName(rocketStatus.getLevel().getName()); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftSendRocketListener.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftSendRocketListener.java index 60d6f422..a0216e4d 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftSendRocketListener.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftSendRocketListener.java @@ -5,14 +5,17 @@ import com.red.circle.mq.business.model.event.gift.OfflineProcessGiftEvent; import com.red.circle.other.app.command.rocket.RocketEnergyAddCmdExe; import com.red.circle.other.app.common.gift.GameLuckyGiftCommon; import com.red.circle.other.app.dto.cmd.RocketEnergyAddCmd; +import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService; import com.red.circle.other.infra.database.cache.service.other.RoomManagerCacheService; import com.red.circle.other.infra.database.mongo.entity.gift.GiftAcceptUser; import com.red.circle.other.infra.database.mongo.entity.gift.GiftGiveRunningWater; import com.red.circle.other.infra.database.mongo.entity.gift.GiftValue; import com.red.circle.other.infra.database.mongo.service.gift.GiftGiveRunningWaterService; import com.red.circle.other.infra.database.mongo.service.live.RoomProfileManagerService; +import com.red.circle.other.inner.enums.config.EnumConfigKey; import com.red.circle.other.inner.enums.material.GiftCurrencyType; import com.red.circle.other.inner.enums.material.GiftTabEnum; +import com.red.circle.tool.core.text.StringUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -35,7 +38,7 @@ public class GiftSendRocketListener implements GiftStrategy { private final RocketEnergyAddCmdExe rocketEnergyAddCmdExe; private final GiftGiveRunningWaterService giftGiveRunningWaterService; private final GameLuckyGiftCommon gameLuckyGiftCommon; - private final RoomProfileManagerService roomProfileManagerService; + private final EnumConfigCacheService enumConfigCacheService; @Override public void processor(OfflineProcessGiftEvent event) { @@ -50,6 +53,20 @@ public class GiftSendRocketListener implements GiftStrategy { return; } + // 7. 只处理在房间内送出的礼物 + String originId = runningWater.getOriginId(); + if (originId == null || !originId.matches("\\d+")) { + log.debug("【火箭能量增加】非房间场景,跳过处理"); + return; + } + + // 跳过白名单用户 + String rocketRoomList = enumConfigCacheService.getValue( + EnumConfigKey.ROCKET_ROOM_LIST, runningWater.getSysOrigin()); + if (StringUtils.isBlank(rocketRoomList) || !rocketRoomList.contains(originId)) { + return; + } + // 2. 只处理金币礼物 if (!GiftCurrencyType.GOLD.eq(runningWater.getGiftValue().getCurrencyType())) { log.debug("【火箭能量增加】非金币礼物,跳过处理"); @@ -75,13 +92,6 @@ public class GiftSendRocketListener implements GiftStrategy { // 6. 计算实际金币价值(考虑幸运礼物加成) Long actualGoldValue = getActualAmount(isLuckyGift, giftValue.getActualAmount(), luckyGiftRatio); - // 7. 只处理在房间内送出的礼物 - String originId = runningWater.getOriginId(); - if (originId == null || !originId.matches("\\d+")) { - log.debug("【火箭能量增加】非房间场景,跳过处理"); - return; - } - Long roomId = Long.parseLong(originId); // 8. 获取送礼用户信息 diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/RocketStatusCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/RocketStatusCO.java index f1e27211..1c9fafdc 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/RocketStatusCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/RocketStatusCO.java @@ -18,7 +18,7 @@ public class RocketStatusCO { /** * 房间ID */ - private Long roomId; + private String roomId; /** * 日期 diff --git a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketConfig.java b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketConfig.java index e44880ce..b5752d43 100644 --- a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketConfig.java +++ b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketConfig.java @@ -19,7 +19,7 @@ public class RocketConfig { /** * 主键ID */ - private Long id; + private String id; /** * 火箭等级 diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/convertor/RocketConfigConvertor.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/convertor/RocketConfigConvertor.java index e0bf2484..02a98b31 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/convertor/RocketConfigConvertor.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/convertor/RocketConfigConvertor.java @@ -26,7 +26,7 @@ public class RocketConfigConvertor { } RocketConfig config = new RocketConfig(); - config.setId(entity.getId()); + config.setId(entity.getId().toString()); config.setLevel(entity.getLevel()); config.setMaxEnergy(entity.getMaxEnergy()); @@ -72,7 +72,7 @@ public class RocketConfigConvertor { } RocketConfigEntity entity = new RocketConfigEntity(); - entity.setId(config.getId()); + entity.setId(Long.parseLong(config.getId())); entity.setLevel(config.getLevel()); entity.setMaxEnergy(config.getMaxEnergy()); diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/RocketConfigEntity.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/RocketConfigEntity.java index c1ddf98e..45d3a574 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/RocketConfigEntity.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/RocketConfigEntity.java @@ -1,5 +1,6 @@ package com.red.circle.other.infra.database.rds.entity; +import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.math.BigDecimal; @@ -12,6 +13,7 @@ import java.time.LocalDateTime; * @date 2025-01-15 */ @Data +@TableName("rocket_config") public class RocketConfigEntity { /** diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketConfigGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketConfigGatewayImpl.java index d26cc5c4..355adf99 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketConfigGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketConfigGatewayImpl.java @@ -51,7 +51,7 @@ public class RocketConfigGatewayImpl implements RocketConfigGateway { public void save(RocketConfig config) { RocketConfigEntity entity = RocketConfigConvertor.toEntity(config); rocketConfigDAO.insert(entity); - config.setId(entity.getId()); + config.setId(entity.getId().toString()); } @Override diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/convertor/RocketInnerConvertor.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/convertor/RocketInnerConvertor.java index 30806f52..1c0f61be 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/convertor/RocketInnerConvertor.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/convertor/RocketInnerConvertor.java @@ -26,7 +26,7 @@ public class RocketInnerConvertor { } RocketConfigDTO dto = new RocketConfigDTO(); - dto.setId(config.getId()); + dto.setId(Long.parseLong(config.getId())); dto.setLevel(config.getLevel()); dto.setMaxEnergy(config.getMaxEnergy()); @@ -63,7 +63,7 @@ public class RocketInnerConvertor { } RocketConfig config = new RocketConfig(); - config.setId(dto.getId()); + config.setId(dto.getId().toString()); config.setLevel(dto.getLevel()); config.setMaxEnergy(dto.getMaxEnergy());