diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/game/ranking/GameRankingQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/game/ranking/GameRankingQryExe.java index a4fcc066..827c2aed 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/game/ranking/GameRankingQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/game/ranking/GameRankingQryExe.java @@ -36,7 +36,7 @@ public class GameRankingQryExe { /** * 缓存过期时间:30秒 */ - private static final long CACHE_EXPIRE_SECONDS = 60; + private static final long CACHE_EXPIRE_SECONDS = 300; public PageResult execute(GameRankingQry qry) { String periodType = qry.getPeriodType() == null ? GameRankingPeriodType.ALL.getCode() : qry.getPeriodType(); @@ -70,7 +70,7 @@ public class GameRankingQryExe { result.setCurrent(pageResult.getCurrent()); result.setSize(pageResult.getSize()); - redisService.setString(cacheKey, JSON.toJSONString(result), CACHE_EXPIRE_SECONDS, TimeUnit.MINUTES); + redisService.setString(cacheKey, JSON.toJSONString(result), CACHE_EXPIRE_SECONDS, TimeUnit.SECONDS); return result; } 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 7fde2d11..11f438f4 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 @@ -72,8 +72,10 @@ public class GameRankingGatewayImpl implements GameRankingGateway { query.addCriteria(Criteria.where("sysOrigin").is(cmd.getSysOrigin())) .addCriteria(Criteria.where("gameOrigin").is(cmd.getGameOrigin())) .addCriteria(Criteria.where("gameId").is(cmd.getGameId())) - .addCriteria(Criteria.where("periodType").is(cmd.getPeriodType())) - .addCriteria(Criteria.where("periodKey").is(cmd.getPeriodKey())); + .addCriteria(Criteria.where("periodType").is(cmd.getPeriodType())); + if (cmd.getPeriodKey() != null) { + query.addCriteria(Criteria.where("periodKey").is(cmd.getPeriodKey())); + } Update update = new Update(); update.inc("totalPrizeAmount", cmd.getAmount());