游戏热门排行榜处理-2

This commit is contained in:
tianfeng 2026-05-28 17:25:14 +08:00
parent 335a1e31fb
commit e1e33f771f
2 changed files with 6 additions and 4 deletions

View File

@ -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<GameRankingCO> 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;
}

View File

@ -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());