From ffbb9320dc6ec36fe827805e13634c725f25d41a Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 28 May 2026 17:32:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=83=AD=E9=97=A8=E6=8E=92?= =?UTF-8?q?=E8=A1=8C=E6=A6=9C=E5=A4=84=E7=90=86-3=20=E6=96=B0=E5=A2=9E=20l?= =?UTF-8?q?atest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/convertor/game/GameRankingConvertor.java | 1 + .../service/game/common/GameEventService.java | 1 + .../app/dto/clientobject/game/GameRankingCO.java | 16 ++++++++++++++++ .../domain/game/GameRankingIncrementCmd.java | 5 +++++ .../other/domain/game/GameRankingRecord.java | 8 ++++++++ .../mongo/entity/game/rank/GameRanking.java | 6 ++++++ .../gateway/game/GameRankingGatewayImpl.java | 2 ++ 7 files changed, 39 insertions(+) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/game/GameRankingConvertor.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/game/GameRankingConvertor.java index 7dc4fccf..72a019f5 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/game/GameRankingConvertor.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/game/GameRankingConvertor.java @@ -30,6 +30,7 @@ public class GameRankingConvertor { co.setSysOrigin(record.getSysOrigin()); co.setTotalPrizeAmount(record.getTotalPrizeAmount()); co.setPeriodType(record.getPeriodType()); + co.setGameCreateTime(record.getGameCreateTime()); return co; } } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/common/GameEventService.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/common/GameEventService.java index 854289cb..78f9616b 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/common/GameEventService.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/common/GameEventService.java @@ -169,6 +169,7 @@ public class GameEventService { .amount(gold) .periodType(GameRankingPeriodType.WEEK.getCode()) .periodKey(ZonedDateTimeAsiaRiyadhUtils.nowWeekMondayToInt().toString()) + .gameCreateTime(gameConfig.getCreateTime()) .build() ); } diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/game/GameRankingCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/game/GameRankingCO.java index e198e61e..61f2c88a 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/game/GameRankingCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/game/GameRankingCO.java @@ -2,6 +2,10 @@ package com.red.circle.other.app.dto.clientobject.game; import lombok.Data; +import java.sql.Timestamp; +import java.time.Duration; +import java.time.Instant; + /** * 游戏排行榜返回对象. * @@ -51,4 +55,16 @@ public class GameRankingCO { * 周期类型 */ private String periodType; + + /** + * 游戏创建时间 + */ + private Timestamp gameCreateTime; + + public boolean isLatest() { + if (gameCreateTime == null) { + return false; + } + return Duration.between(gameCreateTime.toInstant(), Instant.now()).toDays() < 7; + } } diff --git a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/game/GameRankingIncrementCmd.java b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/game/GameRankingIncrementCmd.java index 8b195c71..e233f5d0 100644 --- a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/game/GameRankingIncrementCmd.java +++ b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/game/GameRankingIncrementCmd.java @@ -57,6 +57,11 @@ public class GameRankingIncrementCmd { */ private String periodKey; + /** + * 游戏创建时间 + */ + private java.sql.Timestamp gameCreateTime; + /** * 中奖金额(单位:分) */ diff --git a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/game/GameRankingRecord.java b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/game/GameRankingRecord.java index e1a9c289..e838baeb 100644 --- a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/game/GameRankingRecord.java +++ b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/game/GameRankingRecord.java @@ -2,6 +2,9 @@ package com.red.circle.other.domain.game; import lombok.Data; +import java.sql.Timestamp; +import java.time.LocalDateTime; + /** * 游戏排行榜领域对象. * @@ -56,4 +59,9 @@ public class GameRankingRecord { * 总中奖金额(单位:分) */ private Long totalPrizeAmount; + + /** + * 游戏创建时间 + */ + private Timestamp gameCreateTime; } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/game/rank/GameRanking.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/game/rank/GameRanking.java index 73e91427..9949b55b 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/game/rank/GameRanking.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/game/rank/GameRanking.java @@ -6,6 +6,7 @@ import org.springframework.data.mongodb.core.index.CompoundIndex; import org.springframework.data.mongodb.core.index.CompoundIndexes; import org.springframework.data.mongodb.core.mapping.Document; +import java.sql.Timestamp; import java.time.LocalDateTime; /** @@ -76,6 +77,11 @@ public class GameRanking { */ private Long totalPrizeAmount; + /** + * 游戏创建时间 + */ + private Timestamp gameCreateTime; + /** * 创建时间 */ diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/game/GameRankingGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/game/GameRankingGatewayImpl.java index 11f438f4..86b1b0b0 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/game/GameRankingGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/game/GameRankingGatewayImpl.java @@ -86,6 +86,7 @@ public class GameRankingGatewayImpl implements GameRankingGateway { update.setOnInsert("gameId", cmd.getGameId()); update.setOnInsert("periodType", cmd.getPeriodType()); update.setOnInsert("periodKey", cmd.getPeriodKey()); + update.setOnInsert("gameCreateTime", cmd.getGameCreateTime()); update.setOnInsert("gameCover", cmd.getGameCover()); update.setOnInsert("gameUrl", cmd.getGameUrl()); update.setOnInsert("gameName", cmd.getGameName()); @@ -107,6 +108,7 @@ public class GameRankingGatewayImpl implements GameRankingGateway { record.setPeriodType(entity.getPeriodType()); record.setPeriodKey(entity.getPeriodKey()); record.setTotalPrizeAmount(entity.getTotalPrizeAmount()); + record.setGameCreateTime(entity.getGameCreateTime()); return record; } }