From 82339cc4e1c40e9741e2003a901d0b6f9fec55a7 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Wed, 3 Dec 2025 12:30:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E6=8E=A5=E5=85=A5=E6=8E=92?= =?UTF-8?q?=E8=A1=8C=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../game/party3rd/GameHkysRestController.java | 26 ++++++++++++++++++- .../app/service/game/HotGameServiceImpl.java | 24 +++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/game/party3rd/GameHkysRestController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/game/party3rd/GameHkysRestController.java index f80782b2..8fd62556 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/game/party3rd/GameHkysRestController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/game/party3rd/GameHkysRestController.java @@ -2,6 +2,7 @@ package com.red.circle.other.adapter.app.game.party3rd; import com.alibaba.fastjson.JSONObject; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; +import com.red.circle.component.game.baishun.request.BaishunChangeCurrencyRequest; import com.red.circle.component.game.hkys.GameHkysService; import com.red.circle.component.game.hkys.props.GameHkysProperties; import com.red.circle.component.game.hkys.request.HkysUserCoinUpdate; @@ -26,6 +27,8 @@ import com.red.circle.other.app.dto.cmd.game.GameLxwlUserInfoCmd; import com.red.circle.other.app.enums.violation.GameOriginEnum; import com.red.circle.other.app.enums.violation.ViolationTypeEnum; import com.red.circle.other.app.util.OfficialNoticeUtils; +import com.red.circle.other.domain.game.GameRankingIncrementCmd; +import com.red.circle.other.domain.gateway.game.GameRankingGateway; import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService; import com.red.circle.other.infra.database.rds.entity.sys.GameListConfig; @@ -71,6 +74,7 @@ public class GameHkysRestController { private final UserProfileAppConvertor userProfileAppConvertor; private final GameListConfigService gameListConfigService; private final ImGroupClient imGroupClient; + private final GameRankingGateway gameRankingGateway; @IgnoreResultResponse @PostMapping("/getUserInfo") @@ -137,10 +141,10 @@ public class GameHkysRestController { cost = BigDecimal.valueOf(5000L); } + GameListConfig gameListConfig = gameListConfigService.getByGameId(cmd.getGameId(), GameOriginEnum.LINGXIAN.name(), sysOrigin); if (cmd.getType() != null && cmd.getType() == 2 && cmd.getCoin() >= cost.longValue()) { UserProfileDTO userProfile = userProfileAppConvertor.toUserProfileDTO( userProfileGateway.getByUserId(userId)); - GameListConfig gameListConfig = gameListConfigService.getByGameId(cmd.getGameId(), GameOriginEnum.LINGXIAN.name(), sysOrigin); if (Objects.nonNull(gameListConfig)) { Map build = OfficialNoticeUtils.buildUserProfile(userProfile); build.put("gameUrl", gameListConfig.getCover()); @@ -156,6 +160,9 @@ public class GameHkysRestController { } } + //累计游戏排行榜 + incGameRankingRecord(cmd, gameListConfig); + /*taskMqMessage.sendTask(TaskApprovalEvent.builder() .taskId(4) .userId(userId) @@ -170,6 +177,23 @@ public class GameHkysRestController { .setData(jsonObject); } + private void incGameRankingRecord(GameLxwlUpdateBalanceCmd request, GameListConfig gameListConfig) { + if (request.getType() != 2 || gameListConfig == null || request.getCoin() <= 0) { + return; + } + + GameRankingIncrementCmd build = GameRankingIncrementCmd.builder() + .gameOrigin(GameOriginEnum.LINGXIAN.name()) + .gameId(gameListConfig.getGameId()) + .gameName(gameListConfig.getName()) + .gameCover(gameListConfig.getCover()) + .sysOrigin(gameListConfig.getSysOrigin()) + .amount(request.getCoin()) + .periodType("ALL") + .build(); + gameRankingGateway.incrementPrizeAmount(build); + } + @IgnoreResultResponse @PostMapping("/orderCompensation") public HkysResponse orderCompensation(@RequestBody JSONObject object) { diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/HotGameServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/HotGameServiceImpl.java index 4311e203..413bc6d4 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/HotGameServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/HotGameServiceImpl.java @@ -19,10 +19,13 @@ import com.red.circle.mq.business.model.event.task.TaskApprovalEvent; import com.red.circle.mq.rocket.business.producer.TaskMqMessage; import com.red.circle.other.app.convertor.user.UserProfileAppConvertor; import com.red.circle.other.app.dto.clientobject.game.HotGameUpdateRequest; +import com.red.circle.other.app.dto.cmd.game.GameLxwlUpdateBalanceCmd; import com.red.circle.other.app.enums.violation.GameOriginEnum; import com.red.circle.other.app.service.game.override.domain.HotGameUserProfile; import com.red.circle.other.app.service.game.override.service.HotGameService; import com.red.circle.other.app.util.OfficialNoticeUtils; +import com.red.circle.other.domain.game.GameRankingIncrementCmd; +import com.red.circle.other.domain.gateway.game.GameRankingGateway; import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService; import com.red.circle.other.infra.database.rds.entity.sys.GameListConfig; @@ -71,6 +74,7 @@ public class HotGameServiceImpl implements HotGameService { private final TaskMqMessage taskMqMessage; private final ImGroupClient imGroupClient; private final GameListConfigService gameListConfigService; + private final GameRankingGateway gameRankingGateway; @Override public HotGameResponse getUserProfile(HotGameUserProfileQuery query) { @@ -213,6 +217,9 @@ public class HotGameServiceImpl implements HotGameService { String sysOrigin = UserCredential.parseToken(param.getToken()).getSysOrigin(); GameListConfig gameListConfig = gameListConfigService.getByGameId(param.getGameId(), GameOriginEnum.HOTGAME.name(), sysOrigin); sendBroadcast(param, gameListConfig); + + //累计游戏排行榜 + incGameRankingRecord(param, gameListConfig); } catch (Exception e) { log.error("hotgame游戏飘窗推送失败 ex:{}", e.getMessage()); } @@ -221,6 +228,23 @@ public class HotGameServiceImpl implements HotGameService { .setErrorCode(HotGameErrorEnum.SERVER_ERROR.getErrorCode()); } + private void incGameRankingRecord(HotGameUserCoinUpdate request, GameListConfig gameListConfig) { + if (request.getType() != 2 || gameListConfig == null || request.getCoin() <= 0) { + return; + } + + GameRankingIncrementCmd build = GameRankingIncrementCmd.builder() + .gameOrigin(GameOriginEnum.HOTGAME.name()) + .gameId(gameListConfig.getGameId()) + .gameName(gameListConfig.getName()) + .gameCover(gameListConfig.getCover()) + .sysOrigin(gameListConfig.getSysOrigin()) + .amount(request.getCoin()) + .periodType("ALL") + .build(); + gameRankingGateway.incrementPrizeAmount(build); + } + private void sendBroadcast(HotGameUserCoinUpdate request, GameListConfig gameListConfig) { if (gameListConfig == null) { return;