diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/impl/UserActivityRechargeServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/impl/UserActivityRechargeServiceImpl.java index c13878b0..5f3824fa 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/impl/UserActivityRechargeServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/impl/UserActivityRechargeServiceImpl.java @@ -23,10 +23,20 @@ public class UserActivityRechargeServiceImpl implements UserActivityRechargeServ private final UserActivityRechargeDAO userActivityRechargeDAO; /** - * 2026春节活动 + * 2026春节充值活动 */ private static final Long FIXED_ACTIVITY_ID = 2007771533988204888L; + /** + * 2026春节抽奖 + */ + private static final Long FIXED_ACTIVITY_ID2 = 2006671533988298666L; + + /** + * 2026斋月抽奖 + */ + private static final Long FIXED_ACTIVITY_ID3 = 2007771533988204877L; + /** * 热游 用户VIP等级 固定id */ @@ -45,6 +55,22 @@ public class UserActivityRechargeServiceImpl implements UserActivityRechargeServ amount ); + userActivityRechargeDAO.incrAmount( + userId, + FIXED_ACTIVITY_ID2, + rechargeDate, + type.name(), + amount + ); + + userActivityRechargeDAO.incrAmount( + userId, + FIXED_ACTIVITY_ID3, + rechargeDate, + type.name(), + amount + ); + userActivityRechargeDAO.incrAmount( userId, VIP_ACTIVITY_ID, diff --git a/rc-service/rc-service-other/other-start/src/test/java/ApiTest.java b/rc-service/rc-service-other/other-start/src/test/java/ApiTest.java index bfccd157..db135875 100644 --- a/rc-service/rc-service-other/other-start/src/test/java/ApiTest.java +++ b/rc-service/rc-service-other/other-start/src/test/java/ApiTest.java @@ -11,6 +11,7 @@ import java.time.LocalDateTime; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.Base64; +import java.util.concurrent.ThreadLocalRandom; public class ApiTest { @@ -89,11 +90,23 @@ public class ApiTest { @Test public void test() { - String[] strings = TeamBillCycleUtils.parseBillBelongToDateRange(20251001); - System.out.println(strings[0]); - System.out.println(strings[1]); + // 测试千分之一概率 + int count1 = 0; + for (int i = 0; i < 10000; i++) { + if (ThreadLocalRandom.current().nextDouble() < 0.001) { + count1++; + } + } + System.out.println("千分之一概率: 1万次测试中命中 " + count1 + " 次"); - System.out.println(LocalDateTime.now()); + // 测试万分之一概率 + int count2 = 0; + for (int i = 0; i < 10000; i++) { + if (ThreadLocalRandom.current().nextDouble() < 0.0001) { + count2++; + } + } + System.out.println("万分之一概率: 1万次测试中命中 " + count2 + " 次"); } @Test