Procházet zdrojové kódy

feat : 接口新增返回参数提交

bilingfeng před 2 roky
rodič
revize
87966fb222

+ 15 - 3
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameListVO.java

@@ -62,10 +62,10 @@ public class GameListVO {
     private String classify;
 
     /**
-     * 游戏分类名车过
+     * 游戏分类名称列表
      */
-    @ApiModelProperty(notes = "游戏分类名称")
-    private String classifyName;
+    @ApiModelProperty(notes = "游戏分类名称列表")
+    private List<String> classifyNameList;
 
     /**
      * 是否父游戏
@@ -91,12 +91,24 @@ public class GameListVO {
     @ApiModelProperty(notes = "关联h5游戏id")
     private Long h5GameId;
 
+    /**
+     * 关联h5游戏名字
+     */
+    @ApiModelProperty(notes = "关联h5游戏名字")
+    private String h5GameName;
+
     /**
      * 关联导量游戏id
      */
     @ApiModelProperty(notes = "关联导量游戏id")
     private Long guideGameId;
 
+    /**
+     * 关联导量游戏名字
+     */
+    @ApiModelProperty(notes = "关联导量游戏名字")
+    private String guideGameName;
+
     /**
      * 支付方式列表
      */

+ 25 - 1
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserListVO.java

@@ -56,11 +56,23 @@ public class UserListVO {
     @ApiModelProperty(notes = "注册渠道id")
     private Long channelId;
 
+    /**
+     * 注册渠道名称
+     */
+    @ApiModelProperty(notes = "注册渠道id")
+    private String channelName;
+
+    /**
+     * cpId
+     */
+    @ApiModelProperty(notes = "cpId")
+    private Long cpId;
+
     /**
      * cp名称
      */
     @ApiModelProperty(notes = "cp名称")
-    private Long cpId;
+    private String cpName;
 
     /**
      * 游戏id
@@ -68,12 +80,24 @@ public class UserListVO {
     @ApiModelProperty(notes = "游戏id")
     private Long gameId;
 
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty(notes = "游戏名称")
+    private String gameName;
+
     /**
      * 游戏应用类型id
      */
     @ApiModelProperty(notes = "游戏应用类型id")
     private Long gameCategoryId;
 
+    /**
+     * 游戏应用类型名称
+     */
+    @ApiModelProperty(notes = "游戏应用类型名称")
+    private Long gameCategoryName;
+
     /**
      * 归因投放人员
      */

+ 7 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameCategoryService.java

@@ -42,6 +42,13 @@ public interface GameCategoryService extends IService<GameCategory> {
      */
     List<GameCategoryParentVO> getGameCategoryParent(Integer type);
 
+    /**
+     * 查询所有标签
+     *
+     * @return : 返回所有父游戏标签
+     */
+    List<GameCategoryParentVO> choiceList();
+
     /**
      * 查询游戏标签列表
      *

+ 12 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameCategoryServiceImpl.java

@@ -75,6 +75,18 @@ public class GameCategoryServiceImpl extends ServiceImpl<GameCategoryMapper, Gam
         return BeanUtils.copyList(gameCategoryList, GameCategoryParentVO.class);
     }
 
+    /**
+     * 查询所有标签
+     *
+     * @return : 返回所有父游戏标签
+     */
+    @Override
+    public List<GameCategoryParentVO> choiceList() {
+        List<GameCategory> gameCategoryList = list(new LambdaQueryWrapper<GameCategory>()
+                .select(GameCategory::getId, GameCategory::getName));
+        return BeanUtils.copyList(gameCategoryList, GameCategoryParentVO.class);
+    }
+
     /**
      * 查询游戏标签列表
      *

+ 39 - 4
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameServiceImpl.java

@@ -374,6 +374,15 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
      */
     @Override
     public IPage<GameListVO> gameList(GameListParam param) {
+        //cp列表
+        Map<Long, String> cpMap = cpService.choiceList().stream()
+                .collect(Collectors.toMap(CpChoiceVO::getId, CpChoiceVO::getCpName));
+        //游戏分类列表
+        Map<Long, String> gameCategoryMap = gameCategoryService.choiceList().stream()
+                .collect(Collectors.toMap(GameCategoryParentVO::getId, GameCategoryParentVO::getName));
+        //查询游戏
+        Map<Long, String> gameMap = this.choiceList().stream()
+                .collect(Collectors.toMap(GameChoiceVO::getId, GameChoiceVO::getName));
         //执行查询
         return page(param.toPage(), new QueryWrapper<Game>().lambda()
                 .eq(param.getCpId() != null, Game::getCpId, param.getCpId())
@@ -389,7 +398,7 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
                         "FIND_IN_SET({0}, classifyParent)", String.valueOf(param.getGameClassifyId()))
                 .eq(param.getStatus() != null, Game::getStatus, param.getStatus())
                 .orderByDesc(Game::getCreateTime)
-        ).convert(this::toVo);
+        ).convert(game -> this.toVo(game, cpMap, gameCategoryMap, gameMap));
     }
 
     /**
@@ -398,18 +407,44 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
      * @param game : 游戏信息
      * @return : 返回展示对象
      */
-    private GameListVO toVo(Game game) {
+    private GameListVO toVo(Game game, Map<Long, String> cpMap, Map<Long, String> gameCategoryMap, Map<Long, String> gameMap) {
         GameListVO gameListVO = BeanUtils.copy(game, GameListVO.class);
         if (gameListVO == null) {
             return null;
         }
-        //游戏是主游戏
+        //cp设置
+        if (gameListVO.getCpId() != null) {
+            gameListVO.setCpName(cpMap.get(gameListVO.getCpId()));
+        }
+        //游戏类型
+        if (gameListVO.getCategory() != null) {
+            gameListVO.setCategoryName(gameCategoryMap.get(gameListVO.getCategory()));
+        }
+        //游戏分类
+        if (gameListVO.getClassify() != null) {
+            String[] classifyIds = gameListVO.getClassify().split(",");
+            List<String> classifyNameList = new ArrayList<>();
+            for (String classifyId : classifyIds) {
+                classifyNameList.add(gameCategoryMap.get(Long.valueOf(classifyId)));
+            }
+            gameListVO.setClassifyNameList(classifyNameList);
+        }
+        //主游戏设置
         if (Objects.equals(game.getParentId(), 0L)) {
             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()));
+        }
+        //关联游戏
+        if (gameListVO.getGuideGameId() != null) {
+            gameListVO.setGuideGameName(gameMap.get(gameListVO.getGuideGameId()));
         }
         //查询支付方式列表
         List<GamePayWayVO> gamePayWayVOList = gamePayWayService.getByGameId(game.getId());