火箭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) {
|
public String concatSysOrigin(SysOriginPlatformEnum sysOrigin) {
|
||||||
|
|||||||
@ -89,7 +89,7 @@ public class RocketStatusQryExe {
|
|||||||
*/
|
*/
|
||||||
private RocketStatusCO buildInitialStatus(Long roomId) {
|
private RocketStatusCO buildInitialStatus(Long roomId) {
|
||||||
RocketStatusCO statusCO = new RocketStatusCO();
|
RocketStatusCO statusCO = new RocketStatusCO();
|
||||||
statusCO.setRoomId(roomId);
|
statusCO.setRoomId(String.valueOf(roomId));
|
||||||
statusCO.setDate(LocalDate.now().toString());
|
statusCO.setDate(LocalDate.now().toString());
|
||||||
statusCO.setLevel(1);
|
statusCO.setLevel(1);
|
||||||
statusCO.setLevelName("一级火箭");
|
statusCO.setLevelName("一级火箭");
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public class RocketConvertor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RocketStatusCO co = new RocketStatusCO();
|
RocketStatusCO co = new RocketStatusCO();
|
||||||
co.setRoomId(rocketStatus.getRoomId());
|
co.setRoomId(String.valueOf(rocketStatus.getRoomId()));
|
||||||
co.setDate(rocketStatus.getDate());
|
co.setDate(rocketStatus.getDate());
|
||||||
co.setLevel(rocketStatus.getLevel().getLevel());
|
co.setLevel(rocketStatus.getLevel().getLevel());
|
||||||
co.setLevelName(rocketStatus.getLevel().getName());
|
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.command.rocket.RocketEnergyAddCmdExe;
|
||||||
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.cmd.RocketEnergyAddCmd;
|
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.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.GiftAcceptUser;
|
||||||
import com.red.circle.other.infra.database.mongo.entity.gift.GiftGiveRunningWater;
|
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.entity.gift.GiftValue;
|
||||||
import com.red.circle.other.infra.database.mongo.service.gift.GiftGiveRunningWaterService;
|
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.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.GiftCurrencyType;
|
||||||
import com.red.circle.other.inner.enums.material.GiftTabEnum;
|
import com.red.circle.other.inner.enums.material.GiftTabEnum;
|
||||||
|
import com.red.circle.tool.core.text.StringUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -35,7 +38,7 @@ public class GiftSendRocketListener implements GiftStrategy {
|
|||||||
private final RocketEnergyAddCmdExe rocketEnergyAddCmdExe;
|
private final RocketEnergyAddCmdExe rocketEnergyAddCmdExe;
|
||||||
private final GiftGiveRunningWaterService giftGiveRunningWaterService;
|
private final GiftGiveRunningWaterService giftGiveRunningWaterService;
|
||||||
private final GameLuckyGiftCommon gameLuckyGiftCommon;
|
private final GameLuckyGiftCommon gameLuckyGiftCommon;
|
||||||
private final RoomProfileManagerService roomProfileManagerService;
|
private final EnumConfigCacheService enumConfigCacheService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processor(OfflineProcessGiftEvent event) {
|
public void processor(OfflineProcessGiftEvent event) {
|
||||||
@ -50,6 +53,20 @@ public class GiftSendRocketListener implements GiftStrategy {
|
|||||||
return;
|
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. 只处理金币礼物
|
// 2. 只处理金币礼物
|
||||||
if (!GiftCurrencyType.GOLD.eq(runningWater.getGiftValue().getCurrencyType())) {
|
if (!GiftCurrencyType.GOLD.eq(runningWater.getGiftValue().getCurrencyType())) {
|
||||||
log.debug("【火箭能量增加】非金币礼物,跳过处理");
|
log.debug("【火箭能量增加】非金币礼物,跳过处理");
|
||||||
@ -75,13 +92,6 @@ public class GiftSendRocketListener implements GiftStrategy {
|
|||||||
// 6. 计算实际金币价值(考虑幸运礼物加成)
|
// 6. 计算实际金币价值(考虑幸运礼物加成)
|
||||||
Long actualGoldValue = getActualAmount(isLuckyGift, giftValue.getActualAmount(), luckyGiftRatio);
|
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);
|
Long roomId = Long.parseLong(originId);
|
||||||
|
|
||||||
// 8. 获取送礼用户信息
|
// 8. 获取送礼用户信息
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public class RocketStatusCO {
|
|||||||
/**
|
/**
|
||||||
* 房间ID
|
* 房间ID
|
||||||
*/
|
*/
|
||||||
private Long roomId;
|
private String roomId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期
|
* 日期
|
||||||
|
|||||||
@ -19,7 +19,7 @@ public class RocketConfig {
|
|||||||
/**
|
/**
|
||||||
* 主键ID
|
* 主键ID
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 火箭等级
|
* 火箭等级
|
||||||
|
|||||||
@ -26,7 +26,7 @@ public class RocketConfigConvertor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RocketConfig config = new RocketConfig();
|
RocketConfig config = new RocketConfig();
|
||||||
config.setId(entity.getId());
|
config.setId(entity.getId().toString());
|
||||||
config.setLevel(entity.getLevel());
|
config.setLevel(entity.getLevel());
|
||||||
config.setMaxEnergy(entity.getMaxEnergy());
|
config.setMaxEnergy(entity.getMaxEnergy());
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ public class RocketConfigConvertor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RocketConfigEntity entity = new RocketConfigEntity();
|
RocketConfigEntity entity = new RocketConfigEntity();
|
||||||
entity.setId(config.getId());
|
entity.setId(Long.parseLong(config.getId()));
|
||||||
entity.setLevel(config.getLevel());
|
entity.setLevel(config.getLevel());
|
||||||
entity.setMaxEnergy(config.getMaxEnergy());
|
entity.setMaxEnergy(config.getMaxEnergy());
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.red.circle.other.infra.database.rds.entity;
|
package com.red.circle.other.infra.database.rds.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -12,6 +13,7 @@ import java.time.LocalDateTime;
|
|||||||
* @date 2025-01-15
|
* @date 2025-01-15
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@TableName("rocket_config")
|
||||||
public class RocketConfigEntity {
|
public class RocketConfigEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class RocketConfigGatewayImpl implements RocketConfigGateway {
|
|||||||
public void save(RocketConfig config) {
|
public void save(RocketConfig config) {
|
||||||
RocketConfigEntity entity = RocketConfigConvertor.toEntity(config);
|
RocketConfigEntity entity = RocketConfigConvertor.toEntity(config);
|
||||||
rocketConfigDAO.insert(entity);
|
rocketConfigDAO.insert(entity);
|
||||||
config.setId(entity.getId());
|
config.setId(entity.getId().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -26,7 +26,7 @@ public class RocketInnerConvertor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RocketConfigDTO dto = new RocketConfigDTO();
|
RocketConfigDTO dto = new RocketConfigDTO();
|
||||||
dto.setId(config.getId());
|
dto.setId(Long.parseLong(config.getId()));
|
||||||
dto.setLevel(config.getLevel());
|
dto.setLevel(config.getLevel());
|
||||||
dto.setMaxEnergy(config.getMaxEnergy());
|
dto.setMaxEnergy(config.getMaxEnergy());
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ public class RocketInnerConvertor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RocketConfig config = new RocketConfig();
|
RocketConfig config = new RocketConfig();
|
||||||
config.setId(dto.getId());
|
config.setId(dto.getId().toString());
|
||||||
config.setLevel(dto.getLevel());
|
config.setLevel(dto.getLevel());
|
||||||
config.setMaxEnergy(dto.getMaxEnergy());
|
config.setMaxEnergy(dto.getMaxEnergy());
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user