火箭ID 类型更改
This commit is contained in:
parent
f91f550e8e
commit
75c1e5522d
@ -385,7 +385,14 @@ public enum EnumConfigKey {
|
||||
/**
|
||||
* 设备注册白名单
|
||||
*/
|
||||
DEVICE_REGISTER_WHITELIST;
|
||||
DEVICE_REGISTER_WHITELIST,
|
||||
|
||||
/**
|
||||
* 火箭房间
|
||||
*/
|
||||
ROCKET_ROOM_LIST,
|
||||
|
||||
;
|
||||
|
||||
|
||||
public String concatSysOrigin(SysOriginPlatformEnum sysOrigin) {
|
||||
|
||||
@ -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("一级火箭");
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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. 获取送礼用户信息
|
||||
|
||||
@ -18,7 +18,7 @@ public class RocketStatusCO {
|
||||
/**
|
||||
* 房间ID
|
||||
*/
|
||||
private Long roomId;
|
||||
private String roomId;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
|
||||
@ -19,7 +19,7 @@ public class RocketConfig {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 火箭等级
|
||||
|
||||
@ -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());
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
/**
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user