From 49a9e10ba26f0a245fafd63dfb9063afd7646b9e Mon Sep 17 00:00:00 2001 From: zhx Date: Mon, 6 Jul 2026 19:58:14 +0800 Subject: [PATCH] fix: shorten weekly room reward event id --- .../app/scheduler/RoomContributionWeeklyRewardTask.java | 5 ++++- .../app/scheduler/RoomContributionWeeklyRewardTaskTest.java | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/RoomContributionWeeklyRewardTask.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/RoomContributionWeeklyRewardTask.java index 76563b97..74d6dbbd 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/RoomContributionWeeklyRewardTask.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/RoomContributionWeeklyRewardTask.java @@ -38,7 +38,10 @@ import org.springframework.stereotype.Component; matchIfMissing = true) public class RoomContributionWeeklyRewardTask { - private static final String OWNER_REWARD_EVENT_PREFIX = "ROOM_CONTRIBUTION_WEEKLY_OWNER_REWARD:"; + /** + * wallet_gold_asset_record.event_id is varchar(50), keep the event id short. + */ + private static final String OWNER_REWARD_EVENT_PREFIX = "RCWR:"; private static final BigDecimal DEFAULT_MIN_CONTRIBUTION = BigDecimal.valueOf(100000); private static final BigDecimal TARAB_MIN_CONTRIBUTION = BigDecimal.valueOf(150000); diff --git a/rc-service/rc-service-other/other-application/src/test/java/com/red/circle/other/app/scheduler/RoomContributionWeeklyRewardTaskTest.java b/rc-service/rc-service-other/other-application/src/test/java/com/red/circle/other/app/scheduler/RoomContributionWeeklyRewardTaskTest.java index 788492e9..f14e3fa5 100644 --- a/rc-service/rc-service-other/other-application/src/test/java/com/red/circle/other/app/scheduler/RoomContributionWeeklyRewardTaskTest.java +++ b/rc-service/rc-service-other/other-application/src/test/java/com/red/circle/other/app/scheduler/RoomContributionWeeklyRewardTaskTest.java @@ -1,6 +1,7 @@ package com.red.circle.other.app.scheduler; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; @@ -30,7 +31,7 @@ import org.springframework.test.util.ReflectionTestUtils; class RoomContributionWeeklyRewardTaskTest { private static final String DATA_ID = "2071532202565136385_20260629"; - private static final String EVENT_ID = "ROOM_CONTRIBUTION_WEEKLY_OWNER_REWARD:" + DATA_ID; + private static final String EVENT_ID = "RCWR:" + DATA_ID; private static final Long ROOM_ID = 2071532202565136385L; private static final Long OWNER_ID = 2071520380357021697L; @@ -71,6 +72,7 @@ class RoomContributionWeeklyRewardTaskTest { assertEquals(OWNER_ID, cmd.getUserId()); assertEquals(SysOriginPlatformEnum.ATYOU, cmd.getSysOrigin()); assertEquals(EVENT_ID, cmd.getEventId()); + assertTrue(cmd.getEventId().length() <= 50); assertEquals(GoldOrigin.ROOM_CONTRIBUTION_REWARD, cmd.getOrigin()); assertEquals(25000000L, cmd.getAmount().getPennyAmount()); verify(roomContributionActivityCountService).markOwnerRewardCoinsSent(DATA_ID, EVENT_ID);