|
@@ -5,14 +5,21 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
|
|
|
import com.zanxiang.game.module.manage.enums.GameStatusEnum;
|
|
|
-import com.zanxiang.game.module.manage.pojo.dto.GameCategoryDTO;
|
|
|
import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
|
|
|
-import com.zanxiang.game.module.manage.pojo.dto.GameTagDTO;
|
|
|
-import com.zanxiang.game.module.manage.pojo.params.*;
|
|
|
-import com.zanxiang.game.module.manage.pojo.vo.*;
|
|
|
-import com.zanxiang.game.module.manage.service.*;
|
|
|
-import com.zanxiang.game.module.mybatis.entity.*;
|
|
|
+import com.zanxiang.game.module.manage.pojo.params.GameAddParam;
|
|
|
+import com.zanxiang.game.module.manage.pojo.params.GameListParam;
|
|
|
+import com.zanxiang.game.module.manage.pojo.vo.GameChoiceVO;
|
|
|
+import com.zanxiang.game.module.manage.pojo.vo.GameInfoVO;
|
|
|
+import com.zanxiang.game.module.manage.pojo.vo.GameListVO;
|
|
|
+import com.zanxiang.game.module.manage.service.ICpService;
|
|
|
+import com.zanxiang.game.module.manage.service.IGamePayWayService;
|
|
|
+import com.zanxiang.game.module.manage.service.IGameService;
|
|
|
+import com.zanxiang.game.module.manage.service.IGameTagService;
|
|
|
+import com.zanxiang.game.module.mybatis.entity.Cp;
|
|
|
+import com.zanxiang.game.module.mybatis.entity.Game;
|
|
|
+import com.zanxiang.game.module.mybatis.entity.GameTag;
|
|
|
import com.zanxiang.game.module.mybatis.mapper.GameMapper;
|
|
|
import com.zanxiang.module.util.bean.BeanUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -39,233 +46,12 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
|
|
|
@Autowired
|
|
|
private IGamePayWayService gamePayWayService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private IGameCategoryService gameCategoryService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private IGameTagService gameTagService;
|
|
|
|
|
|
@Autowired
|
|
|
private ICpService cpService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private IGameAppletService gameAppletService;
|
|
|
-
|
|
|
- @Override
|
|
|
- public GameDockVO getGameDock(Long id) {
|
|
|
- Game game = super.getById(id);
|
|
|
- GameDockVO gameDockVO = BeanUtil.copy(game, GameDockVO.class);
|
|
|
- if (gameDockVO == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- Cp cp = cpService.getById(gameDockVO.getCpId());
|
|
|
- if (cp != null) {
|
|
|
- gameDockVO.setCpName(cp.getCpName());
|
|
|
- }
|
|
|
- GameApplet gameApplet = gameAppletService.getOne(new LambdaQueryWrapper<GameApplet>().eq(GameApplet::getGameId, gameDockVO.getId()));
|
|
|
- if (gameApplet != null) {
|
|
|
- gameDockVO.setAppId(gameApplet.getAppId());
|
|
|
- gameDockVO.setAppSecret(gameApplet.getAppSecret());
|
|
|
- }
|
|
|
- return gameDockVO;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Boolean gameDockUpdate(GameDockParam param) {
|
|
|
- if (Strings.isNotBlank(param.getAppKey())) {
|
|
|
- super.update(new LambdaUpdateWrapper<Game>()
|
|
|
- .set(Game::getAppKey, param.getAppKey())
|
|
|
- .set(Game::getUpdateTime, LocalDateTime.now())
|
|
|
- .eq(Game::getId, param.getId()));
|
|
|
- }
|
|
|
- if (Strings.isBlank(param.getAppId()) && Strings.isBlank(param.getAppSecret())) {
|
|
|
- return Boolean.TRUE;
|
|
|
- }
|
|
|
- GameApplet gameApplet = gameAppletService.getOne(new LambdaQueryWrapper<GameApplet>()
|
|
|
- .eq(GameApplet::getGameId, param.getId()));
|
|
|
- if (gameApplet == null) {
|
|
|
- gameApplet = GameApplet.builder()
|
|
|
- .gameId(param.getId())
|
|
|
- .createTime(LocalDateTime.now())
|
|
|
- .build();
|
|
|
- }
|
|
|
- gameApplet.setUpdateTime(LocalDateTime.now());
|
|
|
- if (Strings.isNotBlank(param.getAppId())) {
|
|
|
- gameApplet.setAppId(param.getAppId());
|
|
|
- }
|
|
|
- if (Strings.isNotBlank(param.getAppSecret())) {
|
|
|
- gameApplet.setAppSecret(param.getAppSecret());
|
|
|
- }
|
|
|
- return gameAppletService.saveOrUpdate(gameApplet);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public GameRelationVO getGameRelation(Long id) {
|
|
|
- Game game = super.getById(id);
|
|
|
- GameRelationVO gameRelationVO = BeanUtil.copy(game, GameRelationVO.class);
|
|
|
- if (gameRelationVO == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- Map<Long, Game> gameMap = this.getGameRelationMap(Collections.singletonList(game));
|
|
|
- //没有关联游戏
|
|
|
- if (gameMap.isEmpty()) {
|
|
|
- return gameRelationVO;
|
|
|
- }
|
|
|
- //设置关联游戏名字
|
|
|
- if (Objects.equals(gameRelationVO.getParentId(), 0L)) {
|
|
|
- gameRelationVO.setParentId(game.getId());
|
|
|
- gameRelationVO.setParentName(game.getName());
|
|
|
- gameRelationVO.setParentCategoryId(game.getCategory());
|
|
|
- } else {
|
|
|
- //非主游戏
|
|
|
- if (gameRelationVO.getParentId() != null && gameMap.containsKey(gameRelationVO.getParentId())) {
|
|
|
- gameRelationVO.setParentName(gameMap.get(gameRelationVO.getParentId()).getName());
|
|
|
- gameRelationVO.setParentCategoryId(gameMap.get(gameRelationVO.getParentId()).getCategory());
|
|
|
- }
|
|
|
- }
|
|
|
- if (gameRelationVO.getGuideGameId() != null && gameMap.containsKey(gameRelationVO.getGuideGameId())) {
|
|
|
- gameRelationVO.setGuideGameName(gameMap.get(gameRelationVO.getGuideGameId()).getName());
|
|
|
- gameRelationVO.setGuideCategoryId(gameMap.get(gameRelationVO.getGuideGameId()).getCategory());
|
|
|
- }
|
|
|
- if (gameRelationVO.getH5GameId() != null && gameMap.containsKey(gameRelationVO.getH5GameId())) {
|
|
|
- gameRelationVO.setH5GameName(gameMap.get(gameRelationVO.getH5GameId()).getName());
|
|
|
- }
|
|
|
- //设置关联游戏应用类型名字
|
|
|
- Set<Long> categoryIdSet = new HashSet<>();
|
|
|
- if (gameRelationVO.getParentCategoryId() != null) {
|
|
|
- categoryIdSet.add(gameRelationVO.getParentCategoryId());
|
|
|
- }
|
|
|
- if (gameRelationVO.getGuideCategoryId() != null) {
|
|
|
- categoryIdSet.add(gameRelationVO.getGuideCategoryId());
|
|
|
- }
|
|
|
- Map<Long, GameCategory> categoryMap = gameCategoryService.listByIds(categoryIdSet).stream()
|
|
|
- .collect(Collectors.toMap(GameCategory::getId, Function.identity()));
|
|
|
- if (gameRelationVO.getParentCategoryId() != null && categoryMap.containsKey(gameRelationVO.getParentCategoryId())) {
|
|
|
- gameRelationVO.setParentCategoryName(categoryMap.get(gameRelationVO.getParentCategoryId()).getName());
|
|
|
- }
|
|
|
- if (gameRelationVO.getGuideCategoryId() != null && categoryMap.containsKey(gameRelationVO.getGuideCategoryId())) {
|
|
|
- gameRelationVO.setGuideCategoryName(categoryMap.get(gameRelationVO.getGuideCategoryId()).getName());
|
|
|
- }
|
|
|
- return gameRelationVO;
|
|
|
- }
|
|
|
-
|
|
|
- private Map<Long, Game> getGameRelationMap(List<Game> gameList) {
|
|
|
- Set<Long> gameIdSet = new HashSet<>();
|
|
|
- gameList.forEach(game -> {
|
|
|
- if (game.getParentId() != null && !Objects.equals(game.getParentId(), 0L)) {
|
|
|
- gameIdSet.add(game.getParentId());
|
|
|
- }
|
|
|
- if (game.getH5GameId() != null) {
|
|
|
- gameIdSet.add(game.getH5GameId());
|
|
|
- }
|
|
|
- if (game.getGuideGameId() != null) {
|
|
|
- gameIdSet.add(game.getGuideGameId());
|
|
|
- }
|
|
|
- });
|
|
|
- if (gameIdSet.isEmpty()) {
|
|
|
- return Collections.emptyMap();
|
|
|
- }
|
|
|
- return super.listByIds(gameIdSet).stream().collect(Collectors.toMap(Game::getId, Function.identity()));
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Boolean guideGameUpdateUpdate(GuideGameUpdateParam param) {
|
|
|
- return super.update(new LambdaUpdateWrapper<Game>()
|
|
|
- .set(param.getGuideGameId() != null, Game::getGuideGameId, param.getGuideGameId())
|
|
|
- .set(Game::getUpdateTime, LocalDateTime.now())
|
|
|
- .eq(Game::getId, param.getId()));
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Boolean relationGameUpdate(RelationGameUpdateParam param) {
|
|
|
- if (param.getParentId() == null && param.getH5GameId() == null) {
|
|
|
- return Boolean.FALSE;
|
|
|
- }
|
|
|
- return super.update(new LambdaUpdateWrapper<Game>()
|
|
|
- .set(param.getParentId() != null, Game::getParentId, param.getParentId())
|
|
|
- .set(param.getH5GameId() != null, Game::getH5GameId, param.getH5GameId())
|
|
|
- .set(Game::getUpdateTime, LocalDateTime.now())
|
|
|
- .eq(Game::getId, param.getId()));
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<GameInfoVO> infoByIds(Collection<Long> gameIds) {
|
|
|
- return listByIds(gameIds).stream().map(game -> BeanUtil.copy(game, GameInfoVO.class)).collect(Collectors.toList());
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public GameInfoVO getGameInfo(Long gameId) {
|
|
|
- Game game = super.getById(gameId);
|
|
|
- GameInfoVO gameInfoVO = BeanUtil.copy(game, GameInfoVO.class);
|
|
|
- if (gameInfoVO == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (gameInfoVO.getCpId() != null) {
|
|
|
- Cp cp = cpService.getById(gameInfoVO.getCpId());
|
|
|
- if (cp != null) {
|
|
|
- gameInfoVO.setCpName(cp.getCpName());
|
|
|
- }
|
|
|
- }
|
|
|
- if (Strings.isNotBlank(game.getTags())) {
|
|
|
- String[] split = game.getTags().split(",");
|
|
|
- List<Long> idList = Arrays.stream(split).map(Long::valueOf).collect(Collectors.toList());
|
|
|
- List<GameTagChoiceVO> gameTagChoiceVOList = gameTagService.listByIds(idList).stream()
|
|
|
- .map(gameTagVO -> BeanUtil.copy(gameTagVO, GameTagChoiceVO.class))
|
|
|
- .collect(Collectors.toList());
|
|
|
- gameInfoVO.setClassifyList(gameTagChoiceVOList);
|
|
|
- }
|
|
|
- if (game.getCategory() != null) {
|
|
|
- GameCategoryDTO gameCategoryDTO = gameCategoryService.getById(game.getCategory());
|
|
|
- gameInfoVO.setCategory(gameCategoryDTO);
|
|
|
- }
|
|
|
- //是否主游戏
|
|
|
- gameInfoVO.setIsParentGame(Objects.equals(gameInfoVO.getParentId(), 0L));
|
|
|
- //关联游戏查询
|
|
|
- Map<Long, Game> gameMap = this.getGameRelationMap(Collections.singletonList(game));
|
|
|
- //没有关联游戏
|
|
|
- if (gameMap.isEmpty()) {
|
|
|
- return gameInfoVO;
|
|
|
- }
|
|
|
- //设置关联游戏名字
|
|
|
- if (gameInfoVO.getParentId() != null && !Objects.equals(gameInfoVO.getParentId(), 0L)) {
|
|
|
- gameInfoVO.setParentName(gameMap.get(gameInfoVO.getParentId()).getName());
|
|
|
- } else {
|
|
|
- gameInfoVO.setParentId(game.getId());
|
|
|
- gameInfoVO.setParentName(game.getName());
|
|
|
- }
|
|
|
- if (gameInfoVO.getH5GameId() != null) {
|
|
|
- gameInfoVO.setH5GameName(gameMap.get(gameInfoVO.getH5GameId()).getName());
|
|
|
- }
|
|
|
- if (gameInfoVO.getGuideGameId() != null) {
|
|
|
- gameInfoVO.setGuideGameName(gameMap.get(gameInfoVO.getGuideGameId()).getName());
|
|
|
- }
|
|
|
- return gameInfoVO;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Boolean updateGameInfo(GameUpdateParam param) {
|
|
|
- //游戏分类处理
|
|
|
- String gameTags = this.getGameTags(param.getClassifyList());
|
|
|
- return super.update(new LambdaUpdateWrapper<Game>()
|
|
|
- .set(Strings.isNotBlank(param.getName()), Game::getName, param.getName())
|
|
|
- .set(param.getCpId() != null, Game::getCpId, param.getCpId())
|
|
|
- .set(Strings.isNotBlank(gameTags), Game::getTags, gameTags)
|
|
|
- .set(param.getCategory() != null, Game::getCategory, param.getCategory())
|
|
|
- .set(param.getShareScale() != null, Game::getShareScale, param.getShareScale())
|
|
|
- .set(Objects.equals(param.getIsParentGame(), Boolean.TRUE), Game::getParentId, 0L)
|
|
|
- .set(!Objects.equals(param.getIsParentGame(), Boolean.TRUE) && param.getParentId() != null,
|
|
|
- Game::getParentId, param.getParentId())
|
|
|
- .set(param.getH5GameId() != null, Game::getH5GameId, param.getH5GameId())
|
|
|
- .set(param.getGuideGameId() != null, Game::getGuideGameId, param.getGuideGameId())
|
|
|
- .set(Strings.isNotBlank(param.getPublicity()), Game::getPublicity, param.getPublicity())
|
|
|
- .set(Strings.isNotBlank(param.getDescription()), Game::getDescription, param.getDescription())
|
|
|
- .set(Strings.isNotBlank(param.getVersion()), Game::getVersion, param.getVersion())
|
|
|
- .set(Strings.isNotBlank(param.getGameUrl()), Game::getGameUrl, param.getGameUrl())
|
|
|
- .set(Strings.isNotBlank(param.getCpPaybackUrl()), Game::getCpPaybackUrl, param.getCpPaybackUrl())
|
|
|
- .set(Game::getUpdateTime, LocalDateTime.now())
|
|
|
- .eq(Game::getId, param.getId()));
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public Boolean gameAddOrUpdate(GameAddParam param) {
|
|
|
//游戏分类处理
|
|
@@ -277,12 +63,13 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
|
|
|
game = Game.builder()
|
|
|
.cpId(param.getCpId())
|
|
|
.name(param.getName())
|
|
|
- .shareScale(param.getShareScale())
|
|
|
.category(param.getCategory())
|
|
|
.tags(gameTags)
|
|
|
- .cpPaybackUrl(param.getCpPaybackUrl())
|
|
|
- .gameUrl(param.getGameUrl())
|
|
|
.status(GameStatusEnum.UN_JOIN_UP.getStatus())
|
|
|
+ .description(param.getDescription())
|
|
|
+ .shareScale(param.getShareScale())
|
|
|
+ .h5GameId(param.getH5GameId())
|
|
|
+ .guideGameId(param.getGuideGameId())
|
|
|
.createTime(LocalDateTime.now())
|
|
|
.updateTime(LocalDateTime.now())
|
|
|
.build();
|
|
@@ -290,13 +77,13 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
|
|
|
game = super.getById(id);
|
|
|
game.setCpId(param.getCpId());
|
|
|
game.setName(param.getName());
|
|
|
- game.setShareScale(param.getShareScale());
|
|
|
game.setTags(gameTags);
|
|
|
+ game.setShareScale(param.getShareScale());
|
|
|
+ game.setH5GameId(param.getH5GameId());
|
|
|
+ game.setGuideGameId(param.getGuideGameId());
|
|
|
+ game.setDescription(param.getDescription());
|
|
|
game.setUpdateTime(LocalDateTime.now());
|
|
|
- game.setCpPaybackUrl(param.getCpPaybackUrl());
|
|
|
- game.setGameUrl(param.getGameUrl());
|
|
|
}
|
|
|
- //设置父游戏id
|
|
|
if (!Objects.equals(param.getIsParentGame(), Boolean.TRUE) && param.getParentGameId() != null) {
|
|
|
game.setParentId(param.getParentGameId());
|
|
|
}
|
|
@@ -307,12 +94,12 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
|
|
|
if (CollectionUtils.isEmpty(tagIdList)) {
|
|
|
return null;
|
|
|
}
|
|
|
- List<GameTagVO> gameTagVOList = gameTagService.listByIds(tagIdList);
|
|
|
+ List<GameTag> gameTagList = gameTagService.listByIds(tagIdList);
|
|
|
Set<Long> tagIdSet = new HashSet<>();
|
|
|
- gameTagVOList.forEach(tag -> {
|
|
|
- tagIdSet.add(tag.getId());
|
|
|
- if (Objects.equals(tag.getIsParent(), Boolean.TRUE) && tag.getParentId() != null) {
|
|
|
- tagIdSet.add(tag.getParentId());
|
|
|
+ gameTagList.forEach(gameTag -> {
|
|
|
+ tagIdSet.add(gameTag.getId());
|
|
|
+ if (Objects.equals(gameTag.getIsParent(), Boolean.TRUE) && gameTag.getParentId() != null) {
|
|
|
+ tagIdSet.add(gameTag.getParentId());
|
|
|
}
|
|
|
});
|
|
|
if (tagIdSet.isEmpty()) {
|
|
@@ -323,16 +110,6 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
|
|
|
|
|
|
@Override
|
|
|
public IPage<GameListVO> gameList(GameListParam param) {
|
|
|
- //cp列表
|
|
|
- Map<Long, String> cpMap = cpService.choiceList().stream()
|
|
|
- .collect(Collectors.toMap(CpChoiceVO::getId, CpChoiceVO::getCpName));
|
|
|
- //游戏应用类型列表
|
|
|
- Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
|
|
|
- //游戏分类标签列表
|
|
|
- Map<Long, GameTagDTO> gameTagMap = gameTagService.gameTagMap();
|
|
|
- //查询游戏
|
|
|
- Map<Long, String> gameMap = this.choiceList().stream()
|
|
|
- .collect(Collectors.toMap(GameChoiceVO::getId, GameChoiceVO::getName));
|
|
|
//分类标签
|
|
|
List<Long> tagIds = new ArrayList<>();
|
|
|
if (param.getGameClassifyId() != null) {
|
|
@@ -366,54 +143,53 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
|
|
|
}
|
|
|
)
|
|
|
.orderByDesc(Game::getCreateTime)
|
|
|
- ).convert(game -> this.toVo(game, cpMap, gameCategoryMap, gameMap, gameTagMap));
|
|
|
+ ).convert(this::toVo);
|
|
|
}
|
|
|
|
|
|
- private GameListVO toVo(Game game, Map<Long, String> cpMap, Map<Long, GameCategoryDTO> gameCategoryMap,
|
|
|
- Map<Long, String> gameMap, Map<Long, GameTagDTO> gameTagMap) {
|
|
|
+ private GameListVO toVo(Game game) {
|
|
|
GameListVO gameListVO = BeanUtil.copy(game, GameListVO.class);
|
|
|
if (gameListVO == null) {
|
|
|
return null;
|
|
|
}
|
|
|
- gameListVO.setClassify(game.getTags());
|
|
|
//cp设置
|
|
|
if (gameListVO.getCpId() != null) {
|
|
|
- gameListVO.setCpName(cpMap.get(gameListVO.getCpId()));
|
|
|
+ Cp cp = cpService.getById(gameListVO.getCpId());
|
|
|
+ gameListVO.setCpName(cp == null ? null : cp.getCpName());
|
|
|
}
|
|
|
//游戏类型
|
|
|
if (gameListVO.getCategory() != null) {
|
|
|
- gameListVO.setCategoryName(gameCategoryMap.get(gameListVO.getCategory()) == null ? null : gameCategoryMap.get(gameListVO.getCategory()).getName());
|
|
|
+ gameListVO.setCategoryName(GameCategoryEnum.getNameByCategory(gameListVO.getCategory()));
|
|
|
}
|
|
|
//游戏分类
|
|
|
- if (gameListVO.getClassify() != null) {
|
|
|
- String[] classifyIds = gameListVO.getClassify().split(",");
|
|
|
- List<String> tagNameList = new ArrayList<>();
|
|
|
- for (String tagId : classifyIds) {
|
|
|
- tagNameList.add(gameTagMap.get(Long.valueOf(tagId)) == null ? null : gameTagMap.get(Long.valueOf(tagId)).getName());
|
|
|
- }
|
|
|
- gameListVO.setClassifyNameList(tagNameList);
|
|
|
- gameListVO.setTagNameList(tagNameList);
|
|
|
+ if (Strings.isNotBlank(gameListVO.getTags())) {
|
|
|
+ List<Long> tagIdList = Arrays.stream(gameListVO.getTags().split(","))
|
|
|
+ .map(Long::parseLong).collect(Collectors.toList());
|
|
|
+ gameListVO.setTagNameList(gameTagService.listByIds(tagIdList).stream()
|
|
|
+ .map(GameTag::getName).collect(Collectors.toList()));
|
|
|
}
|
|
|
//主游戏设置
|
|
|
- if (Objects.equals(game.getParentId(), 0L)) {
|
|
|
- gameListVO.setIsParentGame(Boolean.TRUE);
|
|
|
- gameListVO.setParentId(game.getId());
|
|
|
- gameListVO.setParentName(game.getName());
|
|
|
+ if (gameListVO.getParentId() != null) {
|
|
|
+ Game parentGame = super.getById(gameListVO.getParentId());
|
|
|
+ if (parentGame != null) {
|
|
|
+ gameListVO.setIsParentGame(Boolean.TRUE);
|
|
|
+ gameListVO.setParentId(game.getId());
|
|
|
+ gameListVO.setParentName(game.getName());
|
|
|
+ }
|
|
|
} else {
|
|
|
gameListVO.setIsParentGame(Boolean.FALSE);
|
|
|
- gameListVO.setParentName(gameMap.get(gameListVO.getParentId()));
|
|
|
}
|
|
|
//h5游戏
|
|
|
if (gameListVO.getH5GameId() != null) {
|
|
|
- gameListVO.setH5GameName(gameMap.get(gameListVO.getH5GameId()));
|
|
|
+ Game h5Game = super.getById(gameListVO.getParentId());
|
|
|
+ gameListVO.setH5GameName(h5Game == null ? null : h5Game.getName());
|
|
|
}
|
|
|
//关联游戏
|
|
|
if (gameListVO.getGuideGameId() != null) {
|
|
|
- gameListVO.setGuideGameName(gameMap.get(gameListVO.getGuideGameId()));
|
|
|
+ Game guideGame = super.getById(gameListVO.getParentId());
|
|
|
+ gameListVO.setGuideGameName(guideGame == null ? null : guideGame.getName());
|
|
|
}
|
|
|
//查询支付方式列表
|
|
|
- List<GamePayWayVO> gamePayWayVOList = gamePayWayService.getByGameId(game.getId());
|
|
|
- gameListVO.setGamePayWayList(gamePayWayVOList);
|
|
|
+ gameListVO.setGamePayWayList(gamePayWayService.getByGameId(game.getId()));
|
|
|
return gameListVO;
|
|
|
}
|
|
|
|
|
@@ -496,4 +272,9 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
|
|
|
.eq(Game::getId, id));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<GameInfoVO> infoByIds(Collection<Long> gameIds) {
|
|
|
+ return listByIds(gameIds).stream().map(game -> BeanUtil.copy(game, GameInfoVO.class)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
}
|