新增FruitParty打榜活动

This commit is contained in:
tianfeng 2025-12-19 16:53:44 +08:00
parent 9802a2c3d0
commit a184773aaf
2 changed files with 26 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package com.red.circle.other.app.service.game;
import com.alibaba.fastjson.JSON;
import com.google.common.base.Throwables;
import com.red.circle.common.business.core.enums.SysOriginPlatformEnum;
import com.red.circle.component.game.baishun.request.BaishunChangeCurrencyRequest;
import com.red.circle.component.game.hotgame.request.HotGameUserCoinUpdate;
import com.red.circle.component.game.hotgame.request.HotGameUserProfileQuery;
import com.red.circle.component.game.hotgame.response.HotGameCoin;
@ -62,6 +63,7 @@ import java.util.concurrent.TimeUnit;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
@ -85,6 +87,8 @@ public class HotGameServiceImpl implements HotGameService {
private final GameRankingGateway gameRankingGateway;
private final GameListCacheService gameListCacheService;
private final RankingActivityService rankingActivityService;
@Value("${red-circle.game-rank.gameid}")
private String gameId;
@Override
public HotGameResponse<HotGameUserProfile> getUserProfile(HotGameUserProfileQuery query) {
@ -219,6 +223,10 @@ public class HotGameServiceImpl implements HotGameService {
incGameRankingRecord(param, gameListConfig);
//游戏参与打榜活动
incGameRankingActivity(param);
//FruitParty
incGameRankingTmpActivity(param);
return new HotGameResponse<HotGameCoin>()
.setData(new HotGameCoin()
.setBalanceCoin(res.getBalance().getDollarAmount().longValue())
@ -239,6 +247,22 @@ public class HotGameServiceImpl implements HotGameService {
.setErrorCode(HotGameErrorEnum.SERVER_ERROR.getErrorCode());
}
private void incGameRankingTmpActivity(HotGameUserCoinUpdate request) {
if (gameId != null && gameId.equals(request.getGameId()) && request.getType() == 2 && request.getCoin() > 0) {
RankingDataUpdateCmd receiverCmd = new RankingDataUpdateCmd();
receiverCmd.setUserId(DataTypeUtils.toLong(request.getUid()));
receiverCmd.setUserSex(1);
receiverCmd.setActivityType(RankingActivityType.FRUIT_PARTY.getCode());
receiverCmd.setCycleType(RankingCycleType.WEEKLY.getCode());
receiverCmd.setCycleKey(ZonedDateTimeAsiaRiyadhUtils.nowWeekMondayToInt().toString());
receiverCmd.setDimension(RankingDimension.GAME_WIN.getCode());
receiverCmd.setIncrementQuantity(request.getCoin());
receiverCmd.setBizNo(request.getGameId());
receiverCmd.setReqSysOrigin(ReqSysOrigin.of("LIKEI"));
rankingActivityService.accumulateRankingData(receiverCmd);
}
}
private void incGameRankingRecord(HotGameUserCoinUpdate request, GameListConfig gameListConfig) {
if (request.getType() != 2 || gameListConfig == null || request.getCoin() <= 0) {
return;

View File

@ -46,6 +46,8 @@ public enum RankingActivityType {
LUCK_GIFT(9999, "LuckGift", "统计送幸运礼物排行"),
KING_GAMES(10, "游戏王活动", "统计游戏数据排行"),
FRUIT_PARTY(11, "FruitParty", "统计游戏数据排行"),
;
/**