From 99915e74d7dd83adce93a7541ce03bda2dbf6b38 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 12 Feb 2026 17:32:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=8B=E6=9C=88=E6=8A=BD=E5=A5=96=E5=85=85?= =?UTF-8?q?=E5=80=BC=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/UserActivityRechargeServiceImpl.java | 28 ++++++++++++++++++- .../other-start/src/test/java/ApiTest.java | 21 +++++++++++--- 2 files changed, 44 insertions(+), 5 deletions(-) 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