游戏列表接口更改, 新增gameOrigin枚举

This commit is contained in:
tianfeng 2025-12-01 16:48:24 +08:00
parent ef12f3ca4b
commit a021eb8de9
8 changed files with 26 additions and 19 deletions

View File

@ -11,6 +11,7 @@ import com.red.circle.component.game.hkys.response.HkysUserProfileResponse;
import com.red.circle.component.game.hkys.response.HyksErrorEnum;
import com.red.circle.component.game.hkys.response.UpdateUserCoinResponse;
import com.red.circle.component.game.hotgame.response.HotGameCoin;
import com.red.circle.component.game.hotgame.response.HotGameErrorEnum;
import com.red.circle.component.game.hotgame.response.HotGameResponse;
import com.red.circle.external.inner.endpoint.message.ImGroupClient;
import com.red.circle.external.inner.model.cmd.message.BroadcastGroupMsgBodyCmd;
@ -22,12 +23,15 @@ 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.cmd.game.GameLxwlUpdateBalanceCmd;
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.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;
import com.red.circle.other.infra.database.rds.service.sys.GameListConfigService;
import com.red.circle.other.inner.enums.config.EnumConfigKey;
import com.red.circle.other.inner.enums.team.TeamPolicyTypeEnum;
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
import com.red.circle.tool.core.date.LocalDateTimeUtils;
import com.red.circle.tool.core.parse.DataTypeUtils;
@ -136,8 +140,7 @@ public class GameHkysRestController {
if (cmd.getType() != null && cmd.getType() == 2 && cmd.getCoin() >= cost.longValue()) {
UserProfileDTO userProfile = userProfileAppConvertor.toUserProfileDTO(
userProfileGateway.getByUserId(userId));
GameListConfig gameListConfig = gameListConfigService.getByGameId(cmd.getGameId(), sysOrigin);
GameListConfig gameListConfig = gameListConfigService.getByGameId(cmd.getGameId(), GameOriginEnum.LINGXIAN.name(), sysOrigin);
if (Objects.nonNull(gameListConfig)) {
Map<Object, Object> build = OfficialNoticeUtils.buildUserProfile(userProfile);
build.put("gameUrl", gameListConfig.getCover());

View File

@ -98,21 +98,12 @@ public class AppConfigRestController extends BaseController {
public List<GameListConfigCO> listGameConfig(AppExtCommand cmd, @RequestParam(required = false) String roomId) {
cmd.setRoomSessionId(roomId);
List<GameListConfigCO> gameListConfigs = new ArrayList<>(appConfigService.listGameConfig(cmd));
//获取用户等级
UserConsumptionLevel userLevel = userProfileGateway.getUserConsumptionLevel(
cmd.requireReqSysOriginEnum(),
cmd.requiredReqUserId());
// 如果在游戏白名单直接可以玩所有游戏
if (checkGameWhite(cmd.getReqUserId(), cmd.requireReqSysOrigin())) {
return gameListConfigs;
}
//审核用户无需等级限制
if (cmd.getReqUserId() == 1864851759420661762L) {
gameListConfigs = new ArrayList<>();
}
return gameListConfigs;
}

View File

@ -109,7 +109,7 @@ public class GameListConfigQryExe {
String data = gameListCacheService.listCache(cmd.requireReqSysOrigin(),
sysOrigin -> JacksonUtils.toJson(sysConfigAppConvertor.toListGameListConfigCO(
gameListConfigService.listShowcaseConfig(cmd.requireReqSysOrigin(),cmd.reqVersionIsGameNew(),!cmd.reqVersionIs191()))),cmd.reqVersionIsGameNew(),cmd.getReqAppIntel().getVersion());
gameListConfigService.listShowcaseConfig(cmd.requireReqSysOrigin(),cmd.reqVersionIsGameNew()))),cmd.reqVersionIsGameNew(),cmd.getReqAppIntel().getVersion());
if (StringUtils.isBlank(data)) {
return Lists.newArrayList();

View File

@ -0,0 +1,11 @@
package com.red.circle.other.app.enums.violation;
public enum GameOriginEnum {
BAISHUN,
HOTGAME,
LINGXIAN
}

View File

@ -25,6 +25,7 @@ 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.cmd.activity.RankingDataUpdateCmd;
import com.red.circle.other.app.enums.violation.GameOriginEnum;
import com.red.circle.other.app.service.activity.RankingActivityService;
import com.red.circle.other.app.util.OfficialNoticeUtils;
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
@ -193,7 +194,7 @@ public class GameBaishunServiceImpl implements GameBaishunService {
UserProfileDTO userProfile = userProfileAppConvertor.toUserProfileDTO(
userProfileGateway.getByUserId(DataTypeUtils.toLong(request.getUserId())));
GameListConfig gameListConfig = gameListConfigService.getByGameId(request.getGameId(), sysOrigin);
GameListConfig gameListConfig = gameListConfigService.getByGameId(request.getGameId(), GameOriginEnum.LINGXIAN.name(), sysOrigin);
if (Objects.nonNull(gameListConfig)) {
Map<Object, Object> build = OfficialNoticeUtils.buildUserProfile(userProfile);
build.put("gameUrl", gameListConfig.getCover());

View File

@ -20,7 +20,7 @@ public interface GameListConfigService extends BaseService<GameListConfig> {
/**
* 获取上架配置.
*/
List<GameListConfig> listShowcaseConfig(String sysOrigin,boolean fullScreen,boolean hotGame);
List<GameListConfig> listShowcaseConfig(String sysOrigin,boolean fullScreen);
/**
* 根据游戏code获得游戏封面图.
@ -45,7 +45,7 @@ public interface GameListConfigService extends BaseService<GameListConfig> {
/**
* 查询游戏信息
*/
GameListConfig getByGameId(String gameId, String sysOrigin);
GameListConfig getByGameId(String gameId, String gameOrigin, String sysOrigin);
/**
* 校验是否有游戏下架

View File

@ -27,11 +27,10 @@ public class GameListConfigServiceImpl extends
BaseServiceImpl<GameListConfigDAO, GameListConfig> implements GameListConfigService {
@Override
public List<GameListConfig> listShowcaseConfig(String sysOrigin,boolean fullScreen,boolean hotGame) {
public List<GameListConfig> listShowcaseConfig(String sysOrigin,boolean fullScreen) {
return query()
.eq(GameListConfig::getSysOrigin, sysOrigin)
.eq(GameListConfig::getShowcase, Boolean.TRUE)
.ne(hotGame,GameListConfig::getGameOrigin,"HOTGAME")
.eq(GameListConfig::getFullScreen, fullScreen)
.orderByDesc(GameListConfig::getSort)
.list();
@ -119,9 +118,10 @@ public class GameListConfigServiceImpl extends
* @param gameId 1345
*/
@Override
public GameListConfig getByGameId(String gameId, String sysOrigin) {
public GameListConfig getByGameId(String gameId, String gameOrigin, String sysOrigin) {
return query()
.eq(GameListConfig::getGameId, gameId)
.eq(GameListConfig::getGameOrigin, gameOrigin)
.eq(GameListConfig::getSysOrigin, sysOrigin)
.last(PageConstant.LIMIT_ONE)
.getOne();

View File

@ -10,6 +10,7 @@ import com.red.circle.external.inner.model.enums.message.OfficialNoticeTypeEnum;
import com.red.circle.framework.core.dto.ReqSysOrigin;
import com.red.circle.other.app.convertor.user.UserProfileAppConvertor;
import com.red.circle.other.app.dto.cmd.activity.RankingDataUpdateCmd;
import com.red.circle.other.app.enums.violation.GameOriginEnum;
import com.red.circle.other.app.service.activity.RankingActivityService;
import com.red.circle.other.app.service.user.user.AppUserDataViolationService;
import com.red.circle.other.app.util.OfficialNoticeUtils;
@ -103,7 +104,7 @@ public class SpringTest {
UserProfileDTO userProfile = userProfileAppConvertor.toUserProfileDTO(
userProfileGateway.getByUserId(DataTypeUtils.toLong(userId)));
GameListConfig gameListConfig = gameListConfigService.getByGameId("1090", "LIKEI");
GameListConfig gameListConfig = gameListConfigService.getByGameId("1090", GameOriginEnum.LINGXIAN.name(), "LIKEI");
if (Objects.nonNull(gameListConfig)) {
Map<Object, Object> build = OfficialNoticeUtils.buildUserProfile(userProfile);
build.put("gameUrl", gameListConfig.getCover());