游戏列表新增了游戏分类字段
This commit is contained in:
parent
65104f9d9b
commit
13b32296c5
@ -49,6 +49,11 @@ public class SysGameListConfigParamCmd extends CommonCommand {
|
|||||||
*/
|
*/
|
||||||
private String gameId;
|
private String gameId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 游戏分类
|
||||||
|
*/
|
||||||
|
private String category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 游戏名称.
|
* 游戏名称.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -49,6 +49,11 @@ public class GameMatchModelConfigDTO extends DTO {
|
|||||||
*/
|
*/
|
||||||
private String gameId;
|
private String gameId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 游戏分类
|
||||||
|
*/
|
||||||
|
private String category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 游戏封面图.
|
* 游戏封面图.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -56,6 +56,11 @@ public class SysGameListConfigDTO extends DTO {
|
|||||||
*/
|
*/
|
||||||
private String gameId;
|
private String gameId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 游戏分类
|
||||||
|
*/
|
||||||
|
private String category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 游戏封面图.
|
* 游戏封面图.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -53,6 +53,11 @@ public class SysGameListConfigCO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String gameCode;
|
private String gameCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 游戏分类
|
||||||
|
*/
|
||||||
|
private String category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 游戏封面图.
|
* 游戏封面图.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -96,15 +96,8 @@ public class AppConfigRestController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/list-game-config")
|
@GetMapping("/list-game-config")
|
||||||
public List<GameListConfigCO> listGameConfig(AppExtCommand cmd, @RequestParam(required = false) String roomId) {
|
public List<GameListConfigCO> listGameConfig(AppExtCommand cmd, @RequestParam(required = false) String roomId) {
|
||||||
cmd.setRoomSessionId(roomId);
|
cmd.setRoomSessionId(roomId);
|
||||||
List<GameListConfigCO> gameListConfigs = new ArrayList<>(appConfigService.listGameConfig(cmd));
|
return appConfigService.listGameConfig(cmd);
|
||||||
|
|
||||||
// 如果在游戏白名单,直接可以玩所有游戏
|
|
||||||
if (checkGameWhite(cmd.getReqUserId(), cmd.requireReqSysOrigin())) {
|
|
||||||
return gameListConfigs;
|
|
||||||
}
|
|
||||||
|
|
||||||
return gameListConfigs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean checkLoginStatus(Long userId) {
|
public Boolean checkLoginStatus(Long userId) {
|
||||||
|
|||||||
@ -109,7 +109,7 @@ public class GameListConfigQryExe {
|
|||||||
|
|
||||||
String data = gameListCacheService.listCache(cmd.requireReqSysOrigin(),
|
String data = gameListCacheService.listCache(cmd.requireReqSysOrigin(),
|
||||||
sysOrigin -> JacksonUtils.toJson(sysConfigAppConvertor.toListGameListConfigCO(
|
sysOrigin -> JacksonUtils.toJson(sysConfigAppConvertor.toListGameListConfigCO(
|
||||||
gameListConfigService.listShowcaseConfig(cmd.requireReqSysOrigin(),cmd.reqVersionIsGameNew()))),cmd.reqVersionIsGameNew(),cmd.getReqAppIntel().getVersion());
|
gameListConfigService.listShowcaseConfig(cmd.requireReqSysOrigin()))),cmd.reqVersionIsGameNew(),cmd.getReqAppIntel().getVersion());
|
||||||
|
|
||||||
if (StringUtils.isBlank(data)) {
|
if (StringUtils.isBlank(data)) {
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
|
|||||||
@ -3,10 +3,15 @@ package com.red.circle.other.app.dto.clientobject.sys;
|
|||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import com.red.circle.framework.dto.ClientObject;
|
import com.red.circle.framework.dto.ClientObject;
|
||||||
|
import com.red.circle.tool.core.date.TimestampUtils;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 游戏列表配置.
|
* 游戏列表配置.
|
||||||
@ -43,6 +48,11 @@ public class GameListConfigCO extends ClientObject {
|
|||||||
*/
|
*/
|
||||||
private String gameOrigin;
|
private String gameOrigin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 游戏分类
|
||||||
|
*/
|
||||||
|
private String category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 游戏封面图.
|
* 游戏封面图.
|
||||||
*/
|
*/
|
||||||
@ -87,4 +97,21 @@ public class GameListConfigCO extends ClientObject {
|
|||||||
* 第三方游戏ID
|
* 第三方游戏ID
|
||||||
*/
|
*/
|
||||||
private Integer thirdGameId;
|
private Integer thirdGameId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Timestamp createTime;
|
||||||
|
|
||||||
|
private boolean isNew;
|
||||||
|
|
||||||
|
public boolean isNew() {
|
||||||
|
if (createTime == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Instant createInstant = createTime.toInstant();
|
||||||
|
Instant now = Instant.now();
|
||||||
|
Duration duration = Duration.between(createInstant, now);
|
||||||
|
return duration.toDays() < 7;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,6 +51,12 @@ public class GameListConfig extends TimestampBaseEntity {
|
|||||||
@TableField("name")
|
@TableField("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 游戏分类
|
||||||
|
*/
|
||||||
|
@TableField("category")
|
||||||
|
private String category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 游戏编号.
|
* 游戏编号.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -20,7 +20,7 @@ public interface GameListConfigService extends BaseService<GameListConfig> {
|
|||||||
/**
|
/**
|
||||||
* 获取上架配置.
|
* 获取上架配置.
|
||||||
*/
|
*/
|
||||||
List<GameListConfig> listShowcaseConfig(String sysOrigin,boolean fullScreen);
|
List<GameListConfig> listShowcaseConfig(String sysOrigin);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据游戏code获得游戏封面图.
|
* 根据游戏code获得游戏封面图.
|
||||||
|
|||||||
@ -27,11 +27,10 @@ public class GameListConfigServiceImpl extends
|
|||||||
BaseServiceImpl<GameListConfigDAO, GameListConfig> implements GameListConfigService {
|
BaseServiceImpl<GameListConfigDAO, GameListConfig> implements GameListConfigService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GameListConfig> listShowcaseConfig(String sysOrigin,boolean fullScreen) {
|
public List<GameListConfig> listShowcaseConfig(String sysOrigin) {
|
||||||
return query()
|
return query()
|
||||||
.eq(GameListConfig::getSysOrigin, sysOrigin)
|
.eq(GameListConfig::getSysOrigin, sysOrigin)
|
||||||
.eq(GameListConfig::getShowcase, Boolean.TRUE)
|
.eq(GameListConfig::getShowcase, Boolean.TRUE)
|
||||||
.eq(GameListConfig::getFullScreen, fullScreen)
|
|
||||||
.orderByDesc(GameListConfig::getSort)
|
.orderByDesc(GameListConfig::getSort)
|
||||||
.list();
|
.list();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user