Browse Source

feat : SDK后台代码提交

bilingfeng 2 years ago
parent
commit
a901c5cf47

+ 24 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/controller/GameController.java

@@ -2,8 +2,10 @@ package com.zanxiang.manage.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.zanxiang.common.domain.ResultVo;
+import com.zanxiang.manage.domain.params.GameAddParam;
 import com.zanxiang.manage.domain.params.GameListParam;
 import com.zanxiang.manage.domain.vo.GameChoiceVO;
+import com.zanxiang.manage.domain.vo.GameInfoVO;
 import com.zanxiang.manage.domain.vo.GameListVO;
 import com.zanxiang.manage.service.GameService;
 import io.swagger.annotations.Api;
@@ -30,6 +32,28 @@ public class GameController {
     @Autowired
     private GameService gameService;
 
+    @ApiOperation(value = "新增游戏")
+    @PostMapping(value = "/add")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameListVO.class)})
+    public ResultVo<Boolean> gameAdd(@RequestBody GameAddParam param) {
+        return new ResultVo<>(gameService.gameAdd(param));
+    }
+
+    @ApiOperation(value = "游戏基本信息更新")
+    @GetMapping(value = "/game/info")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameInfoVO.class)})
+    public ResultVo<GameInfoVO> getGameInfo(@RequestParam Long id) {
+        return new ResultVo<>(gameService.getGameInfo(id));
+    }
+
+//    @ApiOperation(value = "游戏账号信息")
+//    @PostMapping(value = "/game/update")
+//    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameListVO.class)})
+//    public ResultVo<IPage<GameListVO>> gameUpdate(@RequestBody GameListParam param) {
+//        return new ResultVo<>(gameService.gameList(param));
+//    }
+
+
     @ApiOperation(value = "游戏列表查询")
     @PostMapping(value = "/list")
     @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameListVO.class)})

+ 66 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameAddParam.java

@@ -0,0 +1,66 @@
+package com.zanxiang.manage.domain.params;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-07
+ * @description : 添加游戏参数
+ */
+@Data
+public class GameAddParam {
+
+    /**
+     * cpId
+     */
+    @NotNull(message = "cpId不可为空")
+    @ApiModelProperty(notes = "cpId")
+    private Long cpId;
+
+    /**
+     * 游戏名称
+     */
+    @NotBlank(message = "游戏名称不可为空")
+    @ApiModelProperty(notes = "游戏名称")
+    private String name;
+
+    /**
+     * 是主父游戏
+     */
+    @ApiModelProperty(notes = "是否主游戏")
+    private Boolean isParentGame;
+
+    /**
+     * 分成比例
+     */
+    @NotNull(message = "分成比例不可为空")
+    @ApiModelProperty(notes = "分成比例")
+    private Double shareScale;
+
+    /**
+     * 游戏分类, 多选
+     */
+    @NotEmpty(message = "游戏分类不可为空")
+    @ApiModelProperty(notes = "游戏分类, 可多选, 至少选一个")
+    private List<Long> classifyList;
+
+    /**
+     * 游戏应用类型
+     */
+    @NotNull(message = "游戏应用类型不可为空")
+    @ApiModelProperty(notes = "游戏应用类型")
+    private Long category;
+
+    /**
+     * 父游戏id
+     */
+    @ApiModelProperty(notes = "父游戏id")
+    private Long parentGameId;
+
+}

+ 99 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameUpdateParam.java

@@ -0,0 +1,99 @@
+package com.zanxiang.manage.domain.params;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-07
+ * @description : 游戏基本信息编辑参数
+ */
+@Data
+public class GameUpdateParam {
+
+    /**
+     * 游戏ID
+     */
+    @ApiModelProperty(notes = "游戏ID")
+    private Long id;
+
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty(notes = "游戏名称")
+    private String name;
+
+    /**
+     * cpId
+     */
+    @ApiModelProperty(notes = "cpId")
+    private Long cpId;
+
+    /**
+     * 游戏分类id, 多个
+     */
+    @ApiModelProperty(notes = "游戏分类id, 多个")
+    private List<Long> classifyList;
+
+    /**
+     * 游戏应用类型Id
+     */
+    @ApiModelProperty(notes = "游戏应用类型Id")
+    private Long category;
+
+    /**
+     * 分成比例
+     */
+    @ApiModelProperty(notes = "分成比例")
+    private Double shareScale;
+
+    /**
+     * 主游戏id
+     */
+    @ApiModelProperty(notes = "主游戏id")
+    private Long parentId;
+
+    /**
+     * 关联H5游戏id
+     */
+    @ApiModelProperty(notes = "关联H5游戏id")
+    private Long h5GameId;
+
+    /**
+     * 导量游戏id
+     */
+    @ApiModelProperty(notes = "导量游戏id")
+    private Long guideGameId;
+
+    /**
+     * 游戏宣传语
+     */
+    @ApiModelProperty(notes = "游戏宣传语")
+    private String publicity;
+
+    /**
+     * 游戏描述
+     */
+    @ApiModelProperty(notes = "游戏描述")
+    private String description;
+
+    /**
+     * 游戏版本
+     */
+    @ApiModelProperty(notes = "游戏版本")
+    private String version;
+
+    /**
+     * 游戏地址
+     */
+    @ApiModelProperty(notes = "游戏地址")
+    private String gameUrl;
+
+    /**
+     * CP回调路径
+     */
+    @ApiModelProperty(notes = "CP回调路径")
+    private String cpPaybackUrl;
+}

+ 123 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameInfoVO.java

@@ -0,0 +1,123 @@
+package com.zanxiang.manage.domain.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-07
+ * @description : 游戏基本信息
+ */
+@Data
+public class GameInfoVO {
+
+    /**
+     * 游戏ID
+     */
+    @ApiModelProperty(notes = "游戏ID")
+    private Long id;
+
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty(notes = "游戏名称")
+    private String name;
+
+    /**
+     * cpId
+     */
+    @ApiModelProperty(notes = "cpId")
+    private Long cpId;
+
+    /**
+     * cp名称
+     */
+    @ApiModelProperty(notes = "cp名称")
+    private String cpName;
+
+    /**
+     * 游戏分类id, 多个
+     */
+    @ApiModelProperty(notes = "游戏分类id, 多个")
+    private List<GameCategoryParentVO> classifyList;
+
+    /**
+     * 游戏应用类型Id
+     */
+    @ApiModelProperty(notes = "游戏应用类型Id")
+    private GameCategoryParentVO category;
+
+    /**
+     * 分成比例
+     */
+    @ApiModelProperty(notes = "分成比例")
+    private Double shareScale;
+
+    /**
+     * 主游戏id
+     */
+    @ApiModelProperty(notes = "主游戏id")
+    private Long parentId;
+
+    /**
+     * 主游戏名字
+     */
+    @ApiModelProperty(notes = "主游戏名字")
+    private String parentName;
+
+    /**
+     * 关联H5游戏id
+     */
+    @ApiModelProperty(notes = "关联H5游戏id")
+    private Long h5GameId;
+
+    /**
+     * 关联H5游戏名字
+     */
+    @ApiModelProperty(notes = "关联H5游戏名字")
+    private String h5GameName;
+
+    /**
+     * 导量游戏id
+     */
+    @ApiModelProperty(notes = "导量游戏id")
+    private Long guideGameId;
+
+    /**
+     * 导量游戏名字
+     */
+    @ApiModelProperty(notes = "导量游戏名字")
+    private Long guideGameName;
+
+    /**
+     * 游戏宣传语
+     */
+    @ApiModelProperty(notes = "游戏宣传语")
+    private String publicity;
+
+    /**
+     * 游戏描述
+     */
+    @ApiModelProperty(notes = "游戏描述")
+    private String description;
+
+    /**
+     * 游戏版本
+     */
+    @ApiModelProperty(notes = "游戏版本")
+    private String version;
+
+    /**
+     * 游戏地址
+     */
+    @ApiModelProperty(notes = "游戏地址")
+    private String gameUrl;
+
+    /**
+     * CP回调路径
+     */
+    @ApiModelProperty(notes = "CP回调路径")
+    private String cpPaybackUrl;
+}

+ 17 - 5
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameListVO.java

@@ -44,10 +44,10 @@ public class GameListVO {
     private Double shareScale;
 
     /**
-     * 游戏类
+     * 游戏
      */
-    @ApiModelProperty(notes = "游戏别id")
-    private Integer classify;
+    @ApiModelProperty(notes = "游戏别id")
+    private String classify;
 
     /**
      * 是否父游戏
@@ -61,6 +61,12 @@ public class GameListVO {
     @ApiModelProperty(notes = "主游戏id")
     private Long parentId;
 
+    /**
+     * 主游戏名字
+     */
+    @ApiModelProperty(notes = "主游戏名字")
+    private String parentName;
+
     /**
      * 关联h5游戏id
      */
@@ -77,13 +83,13 @@ public class GameListVO {
      * 支付方式列表
      */
     @ApiModelProperty(notes = "支付方式列表")
-    private List<GamePayWayVO> gamePayWayVOList;
+    private List<GamePayWayVO> gamePayWayList;
 
     /**
      * 游戏订单起量切换以及规则配置
      */
     @ApiModelProperty(notes = "游戏订单起量切换以及规则配置")
-    private List<GameStrategyVO> gameStrategyVOList;
+    private List<GameStrategyVO> gameStrategyList;
 
     /**
      * CP回调地址
@@ -96,4 +102,10 @@ public class GameListVO {
      */
     @ApiModelProperty(notes = "游戏地址")
     private String gameUrl;
+
+    /**
+     * 上线状态1 接入中, 2 可上线, 3 已下线
+     */
+    @ApiModelProperty(notes = "上线状态1 接入中, 2 可上线, 3 已下线")
+    private Integer status;
 }

+ 6 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserVO.java

@@ -69,6 +69,12 @@ public class UserVO {
     @ApiModelProperty(notes = "证件号码")
     private String idCard;
 
+    /**
+     * 绑定手机号码
+     */
+    @ApiModelProperty(notes = "绑定手机号码")
+    private String mobile;
+
     /**
      * 注册手机号
      */

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

@@ -20,11 +20,11 @@ public interface GameCategoryService extends IService<GameCategory> {
     /**
      * 根据主键id查询分类以及子分类
      *
-     * @param id   : 主键id
-     * @param type : 类型
+     * @param idList : 主键id列表
+     * @param type   : 类型
      * @return : 返回游戏分类信息
      */
-    List<GameCategoryVO> listById(Long id, Integer type);
+    List<GameCategoryVO> listByIdList(List<Long> idList, Integer type);
 
     /**
      * 根据主键id查询

+ 18 - 10
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameService.java

@@ -3,8 +3,10 @@ package com.zanxiang.manage.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zanxiang.manage.domain.dto.GameDTO;
+import com.zanxiang.manage.domain.params.GameAddParam;
 import com.zanxiang.manage.domain.params.GameListParam;
 import com.zanxiang.manage.domain.vo.GameChoiceVO;
+import com.zanxiang.manage.domain.vo.GameInfoVO;
 import com.zanxiang.manage.domain.vo.GameListVO;
 import com.zanxiang.mybatis.entity.Game;
 
@@ -18,6 +20,22 @@ import java.util.Map;
  */
 public interface GameService extends IService<Game> {
 
+    /**
+     * 获取游戏基本信息
+     *
+     * @param gameId : 游戏id
+     * @return : 返回游戏信息
+     */
+    GameInfoVO getGameInfo(Long gameId);
+
+    /**
+     * 新增游戏
+     *
+     * @param param : 游戏新增参数
+     * @return : 返回添加结果
+     */
+    Boolean gameAdd(GameAddParam param);
+
     /**
      * 查询游戏列表
      *
@@ -50,14 +68,4 @@ public interface GameService extends IService<Game> {
      * @return : 返回游戏信息列表
      */
     Map<Long, GameDTO> gameCondition(Long cpId, Long gameId, Long gameCategoryId);
-
-    /**
-     * 游戏查询条件
-     *
-     * @param cpId           : cp唯一键
-     * @param gameId         : 游戏id
-     * @param gameCategoryId : 分类id
-     * @return : 返回游戏信息列表, null 标识未匹配到游戏, 空表示没有条件
-     */
-    List<GameDTO> getGameList(Long cpId, Long gameId, Long gameCategoryId);
 }

+ 4 - 5
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameCategoryServiceImpl.java

@@ -34,16 +34,15 @@ public class GameCategoryServiceImpl extends ServiceImpl<GameCategoryMapper, Gam
     /**
      * 根据主键id查询分类以及子分类
      *
-     * @param id   : 主键id
-     * @param type : 类型
+     * @param idList : 主键id列表
+     * @param type   : 类型
      * @return : 返回游戏分类信息
      */
     @Override
-    public List<GameCategoryVO> listById(Long id, Integer type) {
+    public List<GameCategoryVO> listByIdList(List<Long> idList, Integer type) {
         List<GameCategory> gameCategoryList = super.list(new LambdaQueryWrapper<GameCategory>()
                 .eq(GameCategory::getType, type)
-                .and(q -> q.eq(GameCategory::getId, id)
-                        .or().eq(GameCategory::getParentId, id)));
+                .in(GameCategory::getId, idList));
         return BeanUtils.copyList(gameCategoryList, GameCategoryVO.class);
     }
 

+ 158 - 18
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameServiceImpl.java

@@ -2,24 +2,28 @@ package com.zanxiang.manage.service.Impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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.common.enums.GameCategoryEnum;
 import com.zanxiang.common.utils.bean.BeanUtils;
 import com.zanxiang.manage.domain.dto.GameDTO;
+import com.zanxiang.manage.domain.params.GameAddParam;
 import com.zanxiang.manage.domain.params.GameListParam;
+import com.zanxiang.manage.domain.params.GameUpdateParam;
 import com.zanxiang.manage.domain.vo.*;
-import com.zanxiang.manage.service.GameCategoryService;
-import com.zanxiang.manage.service.GamePayWayService;
-import com.zanxiang.manage.service.GameService;
-import com.zanxiang.manage.service.GameStrategyService;
+import com.zanxiang.manage.service.*;
+import com.zanxiang.mybatis.entity.Cp;
 import com.zanxiang.mybatis.entity.Game;
 import com.zanxiang.mybatis.mapper.GameMapper;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
@@ -42,6 +46,141 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
     @Autowired
     private GameCategoryService gameCategoryService;
 
+    @Autowired
+    private CpService cpService;
+
+    /**
+     * 获取游戏基本信息
+     *
+     * @param gameId : 游戏id
+     * @return : 返回游戏信息
+     */
+    @Override
+    public GameInfoVO getGameInfo(Long gameId) {
+        Game game = super.getById(gameId);
+        GameInfoVO gameInfoVO = BeanUtils.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.getClassify())) {
+            String[] split = game.getClassify().split(",");
+            List<Long> idList = Arrays.stream(split).map(Long::valueOf).collect(Collectors.toList());
+            List<GameCategoryVO> gameCategoryList = gameCategoryService.listByIdList(idList, GameCategoryEnum.GAME_LABEL.getCategoryType());
+            gameInfoVO.setClassifyList(BeanUtils.copyList(gameCategoryList, GameCategoryParentVO.class));
+        }
+        if (game.getCategory() != null) {
+            GameCategoryVO gameCategoryVO = gameCategoryService.getById(game.getCategory());
+            gameInfoVO.setCategory(BeanUtils.copy(gameCategoryVO, GameCategoryParentVO.class));
+        }
+        //游戏名字
+        List<Long> gameIdList = new ArrayList<>();
+        if (gameInfoVO.getParentId() != null && !Objects.equals(gameInfoVO.getParentId(), 0L)) {
+            gameIdList.add(gameInfoVO.getParentId());
+        }
+        if (gameInfoVO.getH5GameId() != null) {
+            gameIdList.add(gameInfoVO.getH5GameId());
+        }
+        if (gameInfoVO.getGuideGameId() != null) {
+            gameIdList.add(gameInfoVO.getGuideGameId());
+        }
+        List<Game> gameList = super.listByIds(gameIdList);
+
+
+        return gameInfoVO;
+    }
+
+    /**
+     * 获取游戏基本信息
+     *
+     * @param param : 游戏更新参数
+     * @return : 返回更新结果
+     */
+    public Boolean updateGameInfo(GameUpdateParam param) {
+        //游戏分类处理
+        List<Long> classifyList = param.getClassifyList();
+        Map<String, String> map = this.getClassifyMap(classifyList);
+        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(map.get("classify")), Game::getClassify, map.get("classify"))
+                .set(Strings.isNotBlank(map.get("classifyParent")), Game::getClassifyParent, map.get("classifyParent"))
+                .set(param.getCategory() != null, Game::getCategory, param.getCategory())
+                .set(param.getShareScale() != null, Game::getShareScale, param.getShareScale())
+                .set(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()));
+    }
+
+
+    /**
+     * 新增游戏
+     *
+     * @param param : 游戏新增参数
+     * @return : 返回添加结果
+     */
+    @Override
+    public Boolean gameAdd(GameAddParam param) {
+        //游戏分类处理
+        List<Long> classifyList = param.getClassifyList();
+        Map<String, String> map = this.getClassifyMap(classifyList);
+        Game game = Game.builder()
+                .cpId(param.getCpId())
+                .name(param.getName())
+                .shareScale(param.getShareScale())
+                .category(param.getCategory())
+                .classify(map.get("classify"))
+                .classifyParent(map.get("classifyParent"))
+                .createTime(LocalDateTime.now())
+                .updateTime(LocalDateTime.now())
+                .build();
+        if (!Objects.equals(param.getIsParentGame(), Boolean.TRUE) && param.getParentGameId() != null) {
+            game.setParentId(param.getParentGameId());
+        }
+        return super.save(game);
+    }
+
+    /**
+     * 分类处理
+     *
+     * @param classifyList : 选的游戏分类列表
+     * @return : 返回分类信息
+     */
+    private Map<String, String> getClassifyMap(List<Long> classifyList) {
+        if (CollectionUtils.isEmpty(classifyList)) {
+            return Collections.emptyMap();
+        }
+        List<GameCategoryVO> gameCategoryVOList = gameCategoryService.listByIdList(classifyList, GameCategoryEnum.GAME_LABEL.getCategoryType());
+        Set<Long> classifySet = new HashSet<>();
+        Set<Long> classifyParentSet = new HashSet<>();
+        gameCategoryVOList.forEach(vo -> {
+            classifySet.add(vo.getId());
+            if (Objects.equals(vo.getParentId(), 0L)) {
+                classifyParentSet.add(vo.getId());
+            }
+        });
+        Map<String, String> map = new HashMap<>(2);
+        if (!classifySet.isEmpty()) {
+            map.put("classify", StringUtils.join(classifySet, ","));
+        }
+        if (!classifyParentSet.isEmpty()) {
+            map.put("classifyParent", StringUtils.join(classifySet, ","));
+        }
+        return map;
+    }
+
     /**
      * 查询游戏列表
      *
@@ -50,11 +189,6 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
      */
     @Override
     public IPage<GameListVO> gameList(GameListParam param) {
-        //查询游戏类别
-        List<GameCategoryVO> gameCategoryVOList = new ArrayList<>();
-        if (Objects.equals(param.getIsParentClassify(), Boolean.TRUE)) {
-            gameCategoryVOList = gameCategoryService.listById(param.getGameClassifyId(), GameCategoryEnum.GAME_LABEL.getCategoryType());
-        }
         //执行查询
         return page(param.toPage(), new QueryWrapper<Game>().lambda()
                 .eq(param.getCpId() != null, Game::getCpId, param.getCpId())
@@ -64,8 +198,10 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
                 .eq(param.getGameCategoryId() != null, Game::getCategory, param.getGameCategoryId())
                 .eq(param.getH5GameId() != null, Game::getH5GameId, param.getH5GameId())
                 .eq(param.getGuideGameId() != null, Game::getGuideGameId, param.getGuideGameId())
-                .eq(param.getGameClassifyId() != null && !Objects.equals(param.getIsParentClassify(), Boolean.TRUE), Game::getClassify, param.getGameClassifyId())
-                .in(param.getGameClassifyId() != null && !gameCategoryVOList.isEmpty(), Game::getClassify, param.getGameClassifyId())
+                .apply(param.getGameClassifyId() != null && !Objects.equals(param.getIsParentClassify(), Boolean.TRUE),
+                        "FIND_IN_SET({0}, classify)", String.valueOf(param.getGameClassifyId()))
+                .apply(param.getGameClassifyId() != null && Objects.equals(param.getIsParentClassify(), Boolean.TRUE),
+                        "FIND_IN_SET({0}, classifyParent)", String.valueOf(param.getGameClassifyId()))
                 .eq(param.getStatus() != null, Game::getStatus, param.getStatus())
                 .orderByDesc(Game::getCreateTime)
         ).convert(this::toVo);
@@ -78,17 +214,22 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
      * @return : 返回展示对象
      */
     private GameListVO toVo(Game game) {
-        if (Objects.isNull(game)) {
+        GameListVO gameListVO = BeanUtils.copy(game, GameListVO.class);
+        if (gameListVO == null) {
             return null;
         }
-        GameListVO gameListVO = BeanUtils.copy(game, GameListVO.class);
-        gameListVO.setIsParentGame(Objects.equals(game.getParentId(), 0L));
+        //游戏是主游戏
+        if (Objects.equals(game.getParentId(), 0L)) {
+            gameListVO.setIsParentGame(Boolean.TRUE);
+            gameListVO.setParentId(game.getId());
+            gameListVO.setParentName(game.getName());
+        }
         //查询支付方式列表
         List<GamePayWayVO> gamePayWayVOList = gamePayWayService.getByGameId(game.getId());
-        gameListVO.setGamePayWayVOList(gamePayWayVOList);
+        gameListVO.setGamePayWayList(gamePayWayVOList);
         //查询规则配置列表
         List<GameStrategyVO> gameStrategyVOList = gameStrategyService.getByGameId(game.getId());
-        gameListVO.setGameStrategyVOList(gameStrategyVOList);
+        gameListVO.setGameStrategyList(gameStrategyVOList);
         return gameListVO;
     }
 
@@ -146,8 +287,7 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
      * @param gameCategoryId : 分类id
      * @return : 返回游戏信息列表, null 标识未匹配到游戏, 空表示没有条件
      */
-    @Override
-    public List<GameDTO> getGameList(Long cpId, Long gameId, Long gameCategoryId) {
+    private List<GameDTO> getGameList(Long cpId, Long gameId, Long gameCategoryId) {
         if (cpId == null && gameId == null && gameCategoryId == null) {
             return Collections.emptyList();
         }

+ 17 - 15
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java

@@ -157,21 +157,23 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     @Transactional(rollbackFor = Exception.class)
     public Boolean userUpdate(UserUpdateParam param) {
         //用户信息更新
-        super.update(new LambdaUpdateWrapper<User>()
-                .eq(User::getId, param.getUserId())
-                .eq(User::getUsername, param.getUsername())
-                .set(Strings.isNotBlank(param.getMobile()), User::getMobile, param.getMobile())
-                .set(Strings.isNotBlank(param.getAliPay()), User::getAliPay, param.getAliPay())
-                .set(Strings.isNotBlank(param.getPassword()), User::getPassword, this.cmfPassword(param.getPassword()))
-                .set(Strings.isNotBlank(param.getMobile()) || Strings.isNotBlank(param.getAliPay())
-                        || Strings.isNotBlank(param.getPassword()), User::getUpdateTime, LocalDateTime.now()));
-//        //用户拓展信息更新
-//        userExtService.update(new LambdaUpdateWrapper<UserExt>()
-//                .eq(UserExt::getUserId, param.getUserId())
-//                .set(Strings.isNotBlank(param.getRealName()), UserExt::getRealName, param.getRealName())
-//                .set(Strings.isNotBlank(param.getIdCard()), UserExt::getIdCard, param.getIdCard())
-//                .set(Strings.isNotBlank(param.getRealName()) || Strings.isNotBlank(param.getIdCard()), UserExt::getUpdateTime, LocalDateTime.now())
-//        );
+        if (Strings.isNotBlank(param.getMobile()) || Strings.isNotBlank(param.getAliPay()) || Strings.isNotBlank(param.getPassword())) {
+            super.update(new LambdaUpdateWrapper<User>()
+                    .eq(User::getId, param.getUserId())
+                    .eq(User::getUsername, param.getUsername())
+                    .set(Strings.isNotBlank(param.getMobile()), User::getMobile, param.getMobile())
+                    .set(Strings.isNotBlank(param.getAliPay()), User::getAliPay, param.getAliPay())
+                    .set(Strings.isNotBlank(param.getPassword()), User::getPassword, this.cmfPassword(param.getPassword()))
+                    .set(User::getUpdateTime, LocalDateTime.now()));
+        }
+        //用户拓展信息更新
+        if (Strings.isNotBlank(param.getRealName()) || Strings.isNotBlank(param.getIdCard())) {
+            userExtService.update(new LambdaUpdateWrapper<UserExt>()
+                    .eq(UserExt::getUserId, param.getUserId())
+                    .set(Strings.isNotBlank(param.getRealName()), UserExt::getRealName, param.getRealName())
+                    .set(Strings.isNotBlank(param.getIdCard()), UserExt::getIdCard, param.getIdCard())
+                    .set(UserExt::getUpdateTime, LocalDateTime.now()));
+        }
         return Boolean.TRUE;
     }
 

+ 12 - 7
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/Game.java

@@ -53,9 +53,14 @@ public class Game {
     private Long category;
 
     /**
-     * 游戏类别
+     * 游戏分类id, 多个
      */
-    private Integer classify;
+    private String classify;
+
+    /**
+     * 游戏分类父id, 多个
+     */
+    private String classifyParent;
 
     /**
      * 网页游戏图标,200*200
@@ -143,11 +148,6 @@ public class Game {
      */
     private LocalDateTime deleteTime;
 
-    /**
-     * 渠道
-     */
-    private Long channel;
-
     /**
      * 分成比例
      */
@@ -168,6 +168,11 @@ public class Game {
      */
     private String gameUrl;
 
+    /**
+     * 游戏版本
+     */
+    private String version;
+
     /**
      * 创建时间
      */