diff --git a/.deploy/prod-deploy/sql/20260715_rocket_config_level_4_5.sql b/.deploy/prod-deploy/sql/20260715_rocket_config_level_4_5.sql new file mode 100644 index 00000000..9cc86474 --- /dev/null +++ b/.deploy/prod-deploy/sql/20260715_rocket_config_level_4_5.sql @@ -0,0 +1,58 @@ +-- rocket_config.level 已有唯一索引;以下两次 INSERT 均通过唯一键读取三级模板,数据量固定为单行。 +-- 新等级先保持禁用,运营确认阈值和奖励后再从 WebConsole 启用,避免未确认配置参与发奖。 +INSERT IGNORE INTO rocket_config ( + id, + level, + max_energy, + reward_config, + reward_quantity, + contributor_reward_rate, + normal_reward_config, + status, + created_at, + updated_at +) +SELECT + 4, + 4, + 150000000, + reward_config, + reward_quantity, + contributor_reward_rate, + normal_reward_config, + 0, + NOW(), + NOW() +FROM rocket_config +WHERE level = 3; + +INSERT IGNORE INTO rocket_config ( + id, + level, + max_energy, + reward_config, + reward_quantity, + contributor_reward_rate, + normal_reward_config, + status, + created_at, + updated_at +) +SELECT + 5, + 5, + 200000000, + reward_config, + reward_quantity, + contributor_reward_rate, + normal_reward_config, + 0, + NOW(), + NOW() +FROM rocket_config +WHERE level = 3; + +SELECT id, level, max_energy, status +FROM rocket_config +WHERE level IN (4, 5) +ORDER BY level; diff --git a/.deploy/test-deploy/sql/20260715_rocket_config_level_4_5.sql b/.deploy/test-deploy/sql/20260715_rocket_config_level_4_5.sql new file mode 100644 index 00000000..9cc86474 --- /dev/null +++ b/.deploy/test-deploy/sql/20260715_rocket_config_level_4_5.sql @@ -0,0 +1,58 @@ +-- rocket_config.level 已有唯一索引;以下两次 INSERT 均通过唯一键读取三级模板,数据量固定为单行。 +-- 新等级先保持禁用,运营确认阈值和奖励后再从 WebConsole 启用,避免未确认配置参与发奖。 +INSERT IGNORE INTO rocket_config ( + id, + level, + max_energy, + reward_config, + reward_quantity, + contributor_reward_rate, + normal_reward_config, + status, + created_at, + updated_at +) +SELECT + 4, + 4, + 150000000, + reward_config, + reward_quantity, + contributor_reward_rate, + normal_reward_config, + 0, + NOW(), + NOW() +FROM rocket_config +WHERE level = 3; + +INSERT IGNORE INTO rocket_config ( + id, + level, + max_energy, + reward_config, + reward_quantity, + contributor_reward_rate, + normal_reward_config, + status, + created_at, + updated_at +) +SELECT + 5, + 5, + 200000000, + reward_config, + reward_quantity, + contributor_reward_rate, + normal_reward_config, + 0, + NOW(), + NOW() +FROM rocket_config +WHERE level = 3; + +SELECT id, level, max_energy, status +FROM rocket_config +WHERE level IN (4, 5) +ORDER BY level; diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/rocket/RocketConfigDTO.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/rocket/RocketConfigDTO.java index 26e3fba9..20752c4e 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/rocket/RocketConfigDTO.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/rocket/RocketConfigDTO.java @@ -22,7 +22,7 @@ public class RocketConfigDTO { private Long id; /** - * 火箭等级 1/2/3 + * 火箭等级 1/2/3/4/5 */ private Integer level; diff --git a/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/command/rocket/RocketConfigQueryExe.java b/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/command/rocket/RocketConfigQueryExe.java index 0ef97055..ec83e433 100644 --- a/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/command/rocket/RocketConfigQueryExe.java +++ b/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/command/rocket/RocketConfigQueryExe.java @@ -88,6 +88,8 @@ public class RocketConfigQueryExe { case 1 -> "一级火箭"; case 2 -> "二级火箭"; case 3 -> "三级火箭"; + case 4 -> "四级火箭"; + case 5 -> "五级火箭"; default -> "未知等级"; }; } diff --git a/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/dto/clienobject/RocketStatisticsCO.java b/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/dto/clienobject/RocketStatisticsCO.java index f4abaab3..a7d31de1 100644 --- a/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/dto/clienobject/RocketStatisticsCO.java +++ b/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/dto/clienobject/RocketStatisticsCO.java @@ -35,7 +35,7 @@ public class RocketStatisticsCO { /** * 各等级发射次数分布 - * key: level (1/2/3) + * key: level (1/2/3/4/5) * value: count */ private Map launchByLevel; diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/room/RoomVoiceProfileCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/room/RoomVoiceProfileCO.java index 022b986d..40a1f1db 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/room/RoomVoiceProfileCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/room/RoomVoiceProfileCO.java @@ -137,7 +137,7 @@ public class RoomVoiceProfileCO extends ClientObject { /** - * 火箭等级 (1-3) + * 火箭等级 (1-5) */ private Integer rocketLevel; 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 aea87602..9a2acc0f 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 @@ -84,6 +84,8 @@ public class RocketConfig { case 1 -> "一级火箭"; case 2 -> "二级火箭"; case 3 -> "三级火箭"; + case 4 -> "四级火箭"; + case 5 -> "五级火箭"; default -> "未知等级"; }; } diff --git a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketLevel.java b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketLevel.java index c6bacba5..0b217c6a 100644 --- a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketLevel.java +++ b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketLevel.java @@ -14,19 +14,29 @@ import lombok.Getter; public enum RocketLevel { /** - * 1级火箭:15万能量 + * 1级火箭:3000万能量 */ - LEVEL_1(1, 150000L, "一级火箭"), + LEVEL_1(1, 30000000L, "一级火箭"), /** - * 2级火箭:50万能量 + * 2级火箭:6000万能量 */ - LEVEL_2(2, 500000L, "二级火箭"), + LEVEL_2(2, 60000000L, "二级火箭"), /** - * 3级火箭:100万能量 + * 3级火箭:1亿能量 */ - LEVEL_3(3, 1000000L, "三级火箭"); + LEVEL_3(3, 100000000L, "三级火箭"), + + /** + * 4级火箭:1.5亿能量 + */ + LEVEL_4(4, 150000000L, "四级火箭"), + + /** + * 5级火箭:2亿能量 + */ + LEVEL_5(5, 200000000L, "五级火箭"); /** * 等级值 @@ -63,7 +73,9 @@ public enum RocketLevel { return switch (this) { case LEVEL_1 -> LEVEL_2; case LEVEL_2 -> LEVEL_3; - case LEVEL_3 -> null; // 三级是最高级,返回null表示需要重置 + case LEVEL_3 -> LEVEL_4; + case LEVEL_4 -> LEVEL_5; + case LEVEL_5 -> null; // 五级是最高级,返回null表示本轮等级链结束 }; } @@ -71,14 +83,19 @@ public enum RocketLevel { * 是否是最高级 */ public boolean isMaxLevel() { - return this == LEVEL_3; + return this == LEVEL_5; } /** * 根据能量值判断等级 */ public static RocketLevel determineLevel(Long energy) { - if (energy >= LEVEL_3.getMaxEnergy()) { + // 枚举阈值用于无数据库配置时的兜底判断,正常发射仍以 rocket_config 为准。 + if (energy >= LEVEL_5.getMaxEnergy()) { + return LEVEL_5; + } else if (energy >= LEVEL_4.getMaxEnergy()) { + return LEVEL_4; + } else if (energy >= LEVEL_3.getMaxEnergy()) { return LEVEL_3; } else if (energy >= LEVEL_2.getMaxEnergy()) { return LEVEL_2; diff --git a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketStatus.java b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketStatus.java index 1a04a999..bf5cb2aa 100644 --- a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketStatus.java +++ b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/rocket/RocketStatus.java @@ -252,7 +252,7 @@ public class RocketStatus { } /** - * 重置状态(三级发射后重置为一级) + * 重置状态(最高级发射后重置为一级) */ public void reset() { this.date = LocalDate.now().toString(); 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 5e0644c6..e8548d3e 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 @@ -22,7 +22,7 @@ public class RocketConfigEntity { private Long id; /** - * 火箭等级 1/2/3 + * 火箭等级 1/2/3/4/5 */ private Integer level;