Ver Fonte

feat : 解决父依赖修改导致的问题, 暂时去掉nacos依赖

bilingfeng há 2 anos atrás
pai
commit
d23d93df10
35 ficheiros alterados com 731 adições e 91 exclusões
  1. 16 10
      game-module/game-common/pom.xml
  2. 2 2
      game-module/game-common/src/main/java/com/zanxiang/common/utils/DateUtils.java
  3. 1 1
      game-module/game-common/src/main/java/com/zanxiang/common/utils/ExceptionUtil.java
  4. 16 0
      game-module/game-common/src/main/java/com/zanxiang/common/utils/IpUtils.java
  5. 21 1
      game-module/game-common/src/main/java/com/zanxiang/common/utils/StringUtils.java
  6. 0 5
      game-module/game-manage/pom.xml
  7. 12 9
      game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserController.java
  8. 64 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/ChannelDTO.java
  9. 22 2
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/UserExtDTO.java
  10. 100 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserVO.java
  11. 138 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserVO.java
  12. 9 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/ChannelService.java
  13. 9 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameUserService.java
  14. 13 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/ChannelServiceImpl.java
  15. 1 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameServiceImpl.java
  16. 1 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserRoleServiceImpl.java
  17. 19 5
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserServiceImpl.java
  18. 9 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserAddressServiceImpl.java
  19. 1 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserExtServiceImpl.java
  20. 70 2
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java
  21. 6 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserService.java
  22. 16 16
      game-module/game-manage/src/main/resources/bootstrap.yml
  23. 2 2
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/Game.java
  24. 37 2
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/GameUser.java
  25. 22 5
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/GameUserRole.java
  26. 5 0
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/User.java
  27. 71 0
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/UserAddress.java
  28. 22 2
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/UserExt.java
  29. 12 0
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/mapper/UserAddressMapper.java
  30. 4 0
      game-module/game-mybatis/src/main/resources/mapper/UserAddressMapper.xml
  31. 2 10
      game-module/game-sdk/src/main/java/com/zanxiang/sdk/common/util/RegisterUtil.java
  32. 3 2
      game-module/game-sdk/src/main/java/com/zanxiang/sdk/controller/PayController.java
  33. 0 1
      game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/RegisterLoginServiceImpl.java
  34. 4 10
      game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/UserTokenServiceImpl.java
  35. 1 1
      game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/WordCheckServiceImpl.java

+ 16 - 10
game-module/game-common/pom.xml

@@ -16,16 +16,16 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
-        <!-- nacos配置中心 -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>
-        <!-- nacos注册中心 -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
-        </dependency>
+<!--        &lt;!&ndash; nacos配置中心 &ndash;&gt;-->
+<!--        <dependency>-->
+<!--            <groupId>com.alibaba.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>-->
+<!--        </dependency>-->
+<!--        &lt;!&ndash; nacos注册中心 &ndash;&gt;-->
+<!--        <dependency>-->
+<!--            <groupId>com.alibaba.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
+<!--        </dependency>-->
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>
@@ -65,6 +65,12 @@
             <artifactId>springfox-swagger-ui</artifactId>
             <version>${swagger2.ui.version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>com.zanxiangnet.module</groupId>
+            <artifactId>zx-util</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 2 - 2
game-module/game-common/src/main/java/com/zanxiang/common/utils/DateUtils.java

@@ -1,6 +1,6 @@
 package com.zanxiang.common.utils;
 
-import org.apache.commons.lang.time.DateFormatUtils;
+import org.apache.commons.lang3.time.DateFormatUtils;
 
 import java.lang.management.ManagementFactory;
 import java.text.DateFormat;
@@ -20,7 +20,7 @@ import java.util.Locale;
  *
  * @author ruoyi
  */
-public class DateUtils extends org.apache.commons.lang.time.DateUtils {
+public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
     public static String YYYY_MM_DD = "yyyy-MM-dd";
 
     public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";

+ 1 - 1
game-module/game-common/src/main/java/com/zanxiang/common/utils/ExceptionUtil.java

@@ -1,6 +1,6 @@
 package com.zanxiang.common.utils;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;

+ 16 - 0
game-module/game-common/src/main/java/com/zanxiang/common/utils/IpUtils.java

@@ -36,4 +36,20 @@ public class IpUtils {
         }
         return ipAddress;
     }
+
+    public static String getHostIp() {
+        try {
+            return InetAddress.getLocalHost().getHostAddress();
+        } catch (UnknownHostException e) {
+        }
+        return "127.0.0.1";
+    }
+
+    public static String getHostName() {
+        try {
+            return InetAddress.getLocalHost().getHostName();
+        } catch (UnknownHostException e) {
+        }
+        return "未知";
+    }
 }

+ 21 - 1
game-module/game-common/src/main/java/com/zanxiang/common/utils/StringUtils.java

@@ -1,5 +1,6 @@
 package com.zanxiang.common.utils;
 
+import com.baomidou.mybatisplus.core.toolkit.ArrayUtils;
 import com.zanxiang.common.text.StrFormatter;
 
 import java.util.Collection;
@@ -10,7 +11,8 @@ import java.util.Map;
  *
  * @author ruoyi
  */
-public class StringUtils extends org.apache.commons.lang.StringUtils {
+public class StringUtils extends org.apache.commons.lang3.StringUtils {
+
     /**
      * 空字符串
      */
@@ -363,4 +365,22 @@ public class StringUtils extends org.apache.commons.lang.StringUtils {
     public static <T> T cast(Object obj) {
         return (T) obj;
     }
+
+    /**
+     * 判断数组里的字符串是否存在空值
+     *
+     * @param css : 需要判断的参数
+     * @return : 返回判断结果
+     */
+    public static boolean isAnyEmpty(final String... css) {
+        if (ArrayUtils.isEmpty(css)) {
+            return false;
+        }
+        for (final String cs : css) {
+            if (isEmpty(cs)) {
+                return true;
+            }
+        }
+        return false;
+    }
 }

+ 0 - 5
game-module/game-manage/pom.xml

@@ -16,11 +16,6 @@
             <groupId>com.zanxiang.game</groupId>
             <version>0.0.1-SNAPSHOT</version>
         </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-            <version>${alibaba.fastjson.version}</version>
-        </dependency>
         <dependency>
             <groupId>com.zanxiang.game</groupId>
             <artifactId>game-common-redis</artifactId>

+ 12 - 9
game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserController.java

@@ -13,6 +13,7 @@ import com.zanxiang.manage.domain.vo.*;
 import com.zanxiang.manage.service.GameUserRoleService;
 import com.zanxiang.manage.service.GameUserService;
 import com.zanxiang.manage.service.UserExtService;
+import com.zanxiang.manage.service.UserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiResponse;
@@ -45,27 +46,29 @@ public class UserController {
     @Autowired
     private GameUserService gameUserService;
 
+    @Autowired
+    private UserService userService;
+
 //    @ApiOperation(value = "玩家列表")
 //    @PostMapping(value = "/list")
 //    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = IpBanVO.class)})
 //    public ResultVo<IPage<IpBanVO>> list(@Validated @RequestBody IpBanListParam param) {
 //        return null;
 //    }
-//
-//    @ApiOperation(value = "玩家详细信息")
-//    @PostMapping(value = "/info")
-//    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = IpBanVO.class)})
-//    public ResultVo<IPage<IpBanVO>> info(@Validated @RequestBody IpBanListParam param) {
-//        return null;
-//    }
-//
+
 //    @ApiOperation(value = "玩家详细信息")
 //    @PostMapping(value = "/update")
 //    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = IpBanVO.class)})
 //    public ResultVo<IPage<IpBanVO>> update(@Validated @RequestBody IpBanListParam param) {
 //        return null;
 //    }
-//
+
+    @ApiOperation(value = "玩家详细信息")
+    @GetMapping(value = "/info")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = UserVO.class)})
+    public ResultVo<UserVO> getUserInfo(@RequestParam Long id) {
+        return ResultVo.ok(userService.getUserInfo(id));
+    }
 
     @ApiOperation(value = "玩家游戏列表")
     @PostMapping(value = "/game/list")

+ 64 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/ChannelDTO.java

@@ -0,0 +1,64 @@
+package com.zanxiang.manage.domain.dto;
+
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-05
+ * @description : 渠道信息
+ */
+@Data
+public class ChannelDTO {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 平台名称
+     */
+    private String channelName;
+
+    /**
+     * 公司名称
+     */
+    private String companyName;
+
+    /**
+     * 联系人
+     */
+    private String linkMan;
+
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 职位
+     */
+    private String position;
+
+    /**
+     * 1 删除  0 正常
+     */
+    private Integer isDelete;
+
+    /**
+     * 删除时间
+     */
+    private LocalDateTime deleteTime;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+}

+ 22 - 2
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/UserExtDTO.java

@@ -33,9 +33,14 @@ public class UserExtDTO {
     private String regEmail;
 
     /**
-     * 真实姓名
+     * 注册游戏id
      */
-    private String realName;
+    private Long regGameId;
+
+    /**
+     * 注册来源
+     */
+    private String regFrom;
 
     /**
      * 是否实名认证
@@ -52,6 +57,21 @@ public class UserExtDTO {
      */
     private String idCard;
 
+    /**
+     * 真实姓名
+     */
+    private String realName;
+
+    /**
+     * 生日
+     */
+    private String birthday;
+
+    /**
+     * 性别, 0 : 未知, 1 : 男, 2 : 女
+     */
+    private Integer sex;
+
     /**
      * 实名认证平台, 1 国家网络防沉迷
      */

+ 100 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserVO.java

@@ -0,0 +1,100 @@
+package com.zanxiang.manage.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-05
+ * @description : 游戏玩家信息
+ */
+@Data
+public class GameUserVO {
+
+    /**
+     * 主键id
+     */
+    private Long id;
+
+    /**
+     * 用户 id
+     */
+    private Long userId;
+
+    /**
+     * 导量的渠道ID
+     */
+    private Long guidedAgentId;
+
+    /**
+     * 游戏ID
+     */
+    private Long gameId;
+
+    /**
+     * 昵称
+     */
+    private String nickname;
+
+    /**
+     * 最近默认 2 默认 1 不默认
+     */
+    private Boolean isDefault;
+
+    /**
+     * 状态 2正常 1锁定
+     */
+    private Boolean status;
+
+    /**
+     * 充值次数
+     */
+    private Integer rechargeCount;
+
+    /**
+     * 充值金额
+     */
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 最近充值时间
+     */
+    private LocalDateTime lastRechargeTime;
+
+    /**
+     * 平台币余额
+     */
+    private BigDecimal platformCoin;
+
+    /**
+     * 是否GS
+     */
+    private Boolean isGs;
+
+    /**
+     * 客服id
+     */
+    private Long customerId;
+
+    /**
+     * 创角数
+     */
+    private Integer roleCount;
+
+    /**
+     * 拥有角色最高vip等级
+     */
+    private Integer roleVipMax;
+
+    /**
+     * 开始玩时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 最后玩时间
+     */
+    private LocalDateTime updateTime;
+}

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

@@ -0,0 +1,138 @@
+package com.zanxiang.manage.domain.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-04
+ * @description : 用户详细信息
+ */
+@ApiModel
+@Data
+public class UserVO {
+
+    /**
+     * 玩家id
+     */
+    @ApiModelProperty(notes = "玩家id")
+    private Long id;
+
+    /**
+     * 用户名
+     */
+    @ApiModelProperty(notes = "用户名")
+    private String username;
+
+    /**
+     * 密码
+     */
+    @ApiModelProperty(notes = "密码")
+    private String password;
+
+    /**
+     * 最高vip
+     */
+    @ApiModelProperty(notes = "最高vip")
+    private Integer vipMax;
+
+    /**
+     * 昵称
+     */
+    @ApiModelProperty(notes = "昵称")
+    private String nickname;
+
+    /**
+     * 真实姓名
+     */
+    @ApiModelProperty(notes = "真实姓名")
+    private String realName;
+
+    /**
+     * 生日
+     */
+    @ApiModelProperty(notes = "生日")
+    private String birthday;
+
+    /**
+     * 性别
+     */
+    @ApiModelProperty(notes = "性别")
+    private Integer sex;
+
+    /**
+     * 证件号码
+     */
+    @ApiModelProperty(notes = "证件号码")
+    private String idCard;
+
+    /**
+     * 注册手机号
+     */
+    @ApiModelProperty(notes = "注册手机号")
+    private String regMobile;
+
+    /**
+     * 注册邮箱
+     */
+    @ApiModelProperty(notes = "注册邮箱")
+    private String regEmail;
+
+    /**
+     * 绑定支付宝
+     */
+    @ApiModelProperty(notes = "绑定支付宝")
+    private String aliPay;
+
+    /**
+     * 地址
+     */
+    @ApiModelProperty(notes = "地址")
+    private String address;
+
+    /**
+     * 注册来源
+     */
+    @ApiModelProperty(notes = "注册来源")
+    private String regFrom;
+
+    /**
+     * 渠道
+     */
+    @ApiModelProperty(notes = "渠道")
+    private String channelName;
+
+    /**
+     * 注册游戏
+     */
+    @ApiModelProperty(notes = "注册游戏")
+    private String regGame;
+
+    /**
+     * -1 为冻结状态, 1 为试玩状态 2为正常状态
+     */
+    @ApiModelProperty(notes = "状态 , -1 为冻结, 1 为试玩 2为正常")
+    private Integer status;
+
+    /**
+     * 设备id
+     */
+    @ApiModelProperty(notes = "设备码")
+    private String deviceId;
+
+    /**
+     * 注册IP
+     */
+    @ApiModelProperty(notes = "注册IP")
+    private String regIp;
+
+    /**
+     * 注册时间
+     */
+    @ApiModelProperty(notes = "注册时间")
+    private LocalDateTime createTime;
+
+}

+ 9 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/ChannelService.java

@@ -1,6 +1,7 @@
 package com.zanxiang.manage.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.manage.domain.dto.ChannelDTO;
 import com.zanxiang.manage.domain.vo.ChannelChoiceVO;
 import com.zanxiang.mybatis.entity.Channel;
 
@@ -19,4 +20,12 @@ public interface ChannelService extends IService<Channel> {
      * @return : 返回所有cp信息
      */
     List<ChannelChoiceVO> choiceList();
+
+    /**
+     * 根据主键id查询
+     *
+     * @param id : 主键id
+     * @return : 返回渠道信息
+     */
+    ChannelDTO getById(Long id);
 }

+ 9 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameUserService.java

@@ -3,6 +3,7 @@ package com.zanxiang.manage.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.zanxiang.manage.domain.params.GameUserListParam;
 import com.zanxiang.manage.domain.vo.GameUserListVO;
+import com.zanxiang.manage.domain.vo.GameUserVO;
 
 /**
  * @author : lingfeng
@@ -18,4 +19,12 @@ public interface GameUserService {
      * @return : 返回单页数据
      */
     IPage<GameUserListVO> gameUserList(GameUserListParam param);
+
+    /**
+     * 获取指定用户对应vip等级最高的用户信息
+     *
+     * @param userId : 用户信息
+     * @return : 返回玩家信息
+     */
+    GameUserVO getMaxVipGameUser(Long userId);
 }

+ 13 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/ChannelServiceImpl.java

@@ -1,6 +1,8 @@
 package com.zanxiang.manage.service.Impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.common.utils.bean.BeanUtils;
+import com.zanxiang.manage.domain.dto.ChannelDTO;
 import com.zanxiang.manage.domain.vo.ChannelChoiceVO;
 import com.zanxiang.manage.service.ChannelService;
 import com.zanxiang.mybatis.entity.Channel;
@@ -35,4 +37,15 @@ public class ChannelServiceImpl extends ServiceImpl<ChannelMapper, Channel> impl
                 .channelSign("SZQhuoreshouyouxinzhanbaoJL(szq-奇迹战神-火热手游新战报-激励-巨网)").build();
         return Arrays.asList(choice1, choice2);
     }
+
+    /**
+     * 根据主键id查询
+     *
+     * @param id : 主键id
+     * @return : 返回渠道信息
+     */
+    @Override
+    public ChannelDTO getById(Long id) {
+        return BeanUtils.copy(super.getById(id), ChannelDTO.class);
+    }
 }

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

@@ -1,6 +1,5 @@
 package com.zanxiang.manage.service.Impl;
 
-import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.utils.bean.BeanUtils;
@@ -11,6 +10,7 @@ import com.zanxiang.mybatis.entity.Game;
 import com.zanxiang.mybatis.mapper.GameMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 import java.util.Collections;
 import java.util.List;

+ 1 - 1
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserRoleServiceImpl.java

@@ -1,8 +1,8 @@
 package com.zanxiang.manage.service.Impl;
 
-import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.utils.StringUtils;

+ 19 - 5
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserServiceImpl.java

@@ -1,8 +1,9 @@
 package com.zanxiang.manage.service.Impl;
 
-import com.alibaba.nacos.common.utils.CollectionUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.utils.StringUtils;
@@ -11,6 +12,7 @@ import com.zanxiang.manage.domain.dto.GameDTO;
 import com.zanxiang.manage.domain.dto.UserDTO;
 import com.zanxiang.manage.domain.params.GameUserListParam;
 import com.zanxiang.manage.domain.vo.GameUserListVO;
+import com.zanxiang.manage.domain.vo.GameUserVO;
 import com.zanxiang.manage.service.GameService;
 import com.zanxiang.manage.service.GameUserService;
 import com.zanxiang.manage.service.UserService;
@@ -22,10 +24,7 @@ import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
 import java.time.LocalTime;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 
 /**
  * @author : lingfeng
@@ -120,4 +119,19 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
         }
         return gameUserListVO;
     }
+
+    /**
+     * 获取指定用户对应vip等级最高的用户信息
+     *
+     * @param userId : 用户信息
+     * @return : 返回玩家信息
+     */
+    @Override
+    public GameUserVO getMaxVipGameUser(Long userId) {
+        List<GameUser> gameUserList = super.list(new LambdaQueryWrapper<GameUser>()
+                .eq(GameUser::getUserId, userId)
+                .select(GameUser::getUserId, GameUser::getRoleVipMax)
+                .orderByDesc(GameUser::getRoleVipMax));
+        return BeanUtils.copy(gameUserList.get(0), GameUserVO.class);
+    }
 }

+ 9 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserAddressServiceImpl.java

@@ -0,0 +1,9 @@
+package com.zanxiang.manage.service.Impl;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-05
+ * @description : 用户地址
+ */
+public class UserAddressServiceImpl {
+}

+ 1 - 1
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserExtServiceImpl.java

@@ -1,9 +1,9 @@
 package com.zanxiang.manage.service.Impl;
 
-import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.utils.StringUtils;
 import com.zanxiang.common.utils.bean.BeanUtils;

+ 70 - 2
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java

@@ -1,15 +1,22 @@
 package com.zanxiang.manage.service.Impl;
 
-import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.common.exception.BaseException;
 import com.zanxiang.common.utils.bean.BeanUtils;
+import com.zanxiang.manage.domain.dto.ChannelDTO;
+import com.zanxiang.manage.domain.dto.GameDTO;
 import com.zanxiang.manage.domain.dto.UserDTO;
-import com.zanxiang.manage.service.UserService;
+import com.zanxiang.manage.domain.dto.UserExtDTO;
+import com.zanxiang.manage.domain.vo.GameUserVO;
+import com.zanxiang.manage.domain.vo.UserVO;
+import com.zanxiang.manage.service.*;
 import com.zanxiang.mybatis.entity.User;
 import com.zanxiang.mybatis.mapper.UserMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.logging.log4j.util.Strings;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.Collections;
@@ -27,6 +34,67 @@ import java.util.stream.Collectors;
 @Service
 public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
 
+    @Autowired
+    private UserExtService userExtService;
+
+    @Autowired
+    private GameService gameService;
+
+    @Autowired
+    private ChannelService channelService;
+
+    @Autowired
+    private GameUserService gameUserService;
+
+    /**
+     * 查询玩家详细信息
+     *
+     * @param userId : 用户id
+     * @return : 返回用户信息
+     */
+    @Override
+    public UserVO getUserInfo(Long userId) {
+        //查询用户信息
+        User user = super.getById(userId);
+        if (user == null) {
+            throw new BaseException("用户信息不存在!");
+        }
+        //查询用户拓展信息
+        UserExtDTO userExtDTO = userExtService.getById(userId);
+        if (userExtDTO == null) {
+            throw new BaseException("用户拓展信息不存在!");
+        }
+        UserVO userVO = BeanUtils.copy(user, UserVO.class);
+        //拓展信息补充
+        userVO.setRealName(userExtDTO.getRealName());
+        userVO.setBirthday(userExtDTO.getBirthday());
+        userVO.setSex(userExtDTO.getSex());
+        userVO.setIdCard(userExtDTO.getIdCard());
+        userVO.setRegMobile(userExtDTO.getRegMobile());
+        userVO.setRegEmail(userExtDTO.getRegEmail());
+        userVO.setRegFrom(userExtDTO.getRegFrom());
+        userVO.setRegIp(userExtDTO.getRegIp());
+        //注册游戏
+        GameDTO gameDTO = gameService.getById(userExtDTO.getRegGameId());
+        if (gameDTO != null) {
+            userVO.setRegGame(gameDTO.getName());
+        }
+        //渠道
+        ChannelDTO channelDTO = channelService.getById(user.getAgentId());
+        if (channelDTO != null) {
+            userVO.setChannelName(channelDTO.getChannelName());
+        }
+        //vip等级
+        GameUserVO maxVipGameUser = gameUserService.getMaxVipGameUser(userId);
+        if (maxVipGameUser != null){
+            userVO.setVipMax(maxVipGameUser.getRoleVipMax());
+        }
+        //地址
+        userVO.setAddress("贝达梦工厂E座二楼趣程科技");
+        return userVO;
+    }
+
+
     /**
      * 玩家相关条件查询用户信息
      *

+ 6 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserService.java

@@ -2,6 +2,7 @@ package com.zanxiang.manage.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zanxiang.manage.domain.dto.UserDTO;
+import com.zanxiang.manage.domain.vo.UserVO;
 import com.zanxiang.mybatis.entity.User;
 
 import java.util.List;
@@ -14,6 +15,11 @@ import java.util.Map;
  */
 public interface UserService extends IService<User> {
 
+    /**
+     * 查询玩家详细信息
+     */
+    UserVO getUserInfo(Long userId);
+
     /**
      * 玩家相关条件查询用户信息
      *

+ 16 - 16
game-module/game-manage/src/main/resources/bootstrap.yml

@@ -12,22 +12,22 @@ spring:
     # 环境配置
     active: dev
   cloud:
-    nacos:
-      discovery:
-        namespace: DEV_game
-        # 服务注册地址
-        server-addr: 118.178.187.109:8848
-      config:
-        namespace: DEV_game
-        # 配置中心地址
-        server-addr: 118.178.187.109:8848
-        # 配置文件格式
-        file-extension: yml
-        # 配置文件分组
-        group: GAME
-        # 共享配置
-        shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
-        max-retry: 10
+#    nacos:
+#      discovery:
+#        namespace: DEV_game
+#        # 服务注册地址
+#        server-addr: 118.178.187.109:8848
+#      config:
+#        namespace: DEV_game
+#        # 配置中心地址
+#        server-addr: 118.178.187.109:8848
+#        # 配置文件格式
+#        file-extension: yml
+#        # 配置文件分组
+#        group: GAME
+#        # 共享配置
+#        shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+#        max-retry: 10
 
   #数据库配置
   datasource:

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

@@ -45,12 +45,12 @@ public class Game {
     /**
      * 游戏标签
      */
-    private String tags;
+    private Long tags;
 
     /**
      * 游戏类型
      */
-    private String category;
+    private Long category;
 
     /**
      * 游戏类别

+ 37 - 2
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/GameUser.java

@@ -58,9 +58,44 @@ public class GameUser {
     private Boolean status;
 
     /**
-     * 累计充值
+     * 充值次数
      */
-    private BigDecimal sumMoney;
+    private Integer rechargeCount;
+
+    /**
+     * 充值金额
+     */
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 最近充值时间
+     */
+    private LocalDateTime lastRechargeTime;
+
+    /**
+     * 平台币余额
+     */
+    private BigDecimal platformCoin;
+
+    /**
+     * 是否GS
+     */
+    private Boolean isGs;
+
+    /**
+     * 客服id
+     */
+    private Long customerId;
+
+    /**
+     * 创角数
+     */
+    private Integer roleCount;
+
+    /**
+     * 拥有角色最高vip等级
+     */
+    private Integer roleVipMax;
 
     /**
      * 开始玩时间

+ 22 - 5
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/GameUserRole.java

@@ -3,8 +3,10 @@ package com.zanxiang.mybatis.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.*;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 /**
@@ -69,17 +71,32 @@ public class GameUserRole {
     /**
      * 角色VIP
      */
-    private Long roleVip;
+    private Long roleVipLevel;
 
     /**
-     * 金钱
+     * 玩家角色战力
      */
-    private Double money;
+    private Long rolePower;
 
     /**
-     * 玩家角色战力
+     * 平台币余额
+     */
+    private BigDecimal platformCoin;
+
+    /**
+     * 充值金额
+     */
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 充值次数
+     */
+    private Integer rechargeCount;
+
+    /**
+     * 最近充值时间
      */
-    private Long combatNum;
+    private LocalDateTime lastRechargeTime;
 
     /**
      * 扩展信息

+ 5 - 0
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/User.java

@@ -56,6 +56,11 @@ public class User {
      */
     private String mobile;
 
+    /**
+     * 绑定支付宝账号
+     */
+    private String aliPay;
+
     /**
      * 设备来源 mobile,android,iphone,ipad,web,pc,mac,wxapp
      */

+ 71 - 0
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/UserAddress.java

@@ -0,0 +1,71 @@
+package com.zanxiang.mybatis.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-05
+ * @description : 用户收货地址
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+@Builder
+@TableName("h_user_address")
+public class UserAddress {
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 用户id
+     */
+    private Long userId;
+
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 邮箱
+     */
+    private String email;
+
+    /**
+     * 是否默认
+     */
+    private Boolean isDefault;
+
+    /**
+     * 收货地址
+     */
+    private String address;
+
+    /**
+     * 1:删除,0: 正常
+     */
+    @TableLogic
+    private Integer isDelete;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+}

+ 22 - 2
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/UserExt.java

@@ -41,9 +41,14 @@ public class UserExt {
     private String regEmail;
 
     /**
-     * 真实姓名
+     * 注册游戏id
      */
-    private String realName;
+    private Long regGameId;
+
+    /**
+     * 注册来源
+     */
+    private String regFrom;
 
     /**
      * 是否实名认证
@@ -60,6 +65,21 @@ public class UserExt {
      */
     private String idCard;
 
+    /**
+     * 真实姓名
+     */
+    private String realName;
+
+    /**
+     * 生日
+     */
+    private String birthday;
+
+    /**
+     * 性别, 0 : 未知, 1 : 男, 2 : 女
+     */
+    private Integer sex;
+
     /**
      * 实名认证平台, 1 国家网络防沉迷
      */

+ 12 - 0
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/mapper/UserAddressMapper.java

@@ -0,0 +1,12 @@
+package com.zanxiang.mybatis.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zanxiang.mybatis.entity.UserAddress;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-05
+ * @description : ${description}
+ */
+public interface UserAddressMapper extends BaseMapper<UserAddress> {
+}

+ 4 - 0
game-module/game-mybatis/src/main/resources/mapper/UserAddressMapper.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zanxiang.mybatis.mapper.UserAddressMapper">
+</mapper>

+ 2 - 10
game-module/game-sdk/src/main/java/com/zanxiang/sdk/common/util/RegisterUtil.java

@@ -1,12 +1,8 @@
 package com.zanxiang.sdk.common.util;
 
-import com.alibaba.nacos.common.utils.MD5Utils;
 import com.zanxiang.common.enums.HttpStatusEnum;
-import com.zanxiang.common.exception.BaseException;
 import org.apache.logging.log4j.util.Strings;
 
-import java.security.NoSuchAlgorithmException;
-
 /**
  * @author : lingfeng
  * @time : 2022-06-22
@@ -122,11 +118,7 @@ public class RegisterUtil {
      */
     public static String cmfPassword(String password) {
         String passwordSalt = password + CMF_PASSWORD_SALT;
-        try {
-            return "###" + MD5Utils.md5Hex(MD5Utils.md5Hex(passwordSalt.getBytes()).getBytes());
-        } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
-            throw new BaseException("密码加密异常");
-        }
+        String charsetName = "UTF-8";
+        return "###" + MD5Util.MD5Encode(MD5Util.MD5Encode(passwordSalt, charsetName), charsetName);
     }
 }

+ 3 - 2
game-module/game-sdk/src/main/java/com/zanxiang/sdk/controller/PayController.java

@@ -1,9 +1,9 @@
 package com.zanxiang.sdk.controller;
 
-import com.alibaba.nacos.common.utils.IPUtil;
 import com.zanxiang.common.domain.ResultMap;
 import com.zanxiang.common.enums.HttpStatusEnum;
 import com.zanxiang.common.enums.PayWayEnum;
+import com.zanxiang.common.utils.IpUtils;
 import com.zanxiang.common.utils.StringUtils;
 import com.zanxiang.sdk.common.annotation.ValidLogin;
 import com.zanxiang.sdk.domain.bo.PlatformOrderBO;
@@ -71,7 +71,8 @@ public class PayController {
         bo.setGameId(product.getGameId());
         bo.setUserId(userId);
         bo.setPayDevice(userData.getDeviceType());
-        bo.setSpbillCreateIp(IPUtil.localHostIP());
+        //todo : 工具类做了修改
+        bo.setSpbillCreateIp(IpUtils.getHostIp());
         bo.setOutTradeNo(product.getOrderId());
         bo.setPayWay(product.getPayWay());
         return payService.payCreate(bo);

+ 0 - 1
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/RegisterLoginServiceImpl.java

@@ -268,7 +268,6 @@ public class RegisterLoginServiceImpl implements RegisterLoginService {
         //创建用户信息
         User user = User.builder()
                 .username(mobile)
-                .regMobile(mobile)
                 .mobile(mobile)
                 .password(RegisterUtil.cmfPassword(password))
                 .deviceId(registerMobileParam.getDeviceId())

+ 4 - 10
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/UserTokenServiceImpl.java

@@ -1,26 +1,24 @@
 package com.zanxiang.sdk.service.Impl;
 
-import com.alibaba.nacos.common.utils.CollectionUtils;
-import com.alibaba.nacos.common.utils.MD5Utils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.enums.ExpireTimeEnum;
 import com.zanxiang.common.enums.HttpStatusEnum;
-import com.zanxiang.common.exception.BaseException;
 import com.zanxiang.common.text.UUID;
 import com.zanxiang.common.utils.DateUtils;
 import com.zanxiang.common.utils.bean.BeanUtils;
 import com.zanxiang.mybatis.entity.UserToken;
 import com.zanxiang.mybatis.mapper.UserTokenMapper;
 import com.zanxiang.sdk.common.constant.RedisKeyConstant;
+import com.zanxiang.sdk.common.util.MD5Util;
 import com.zanxiang.sdk.common.util.RedisUtil;
 import com.zanxiang.sdk.domain.dto.UserTokenDTO;
 import com.zanxiang.sdk.service.UserTokenService;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.security.NoSuchAlgorithmException;
 import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Objects;
@@ -192,13 +190,9 @@ public class UserTokenServiceImpl extends ServiceImpl<UserTokenMapper, UserToken
     private String createToken(Long userId, Integer deviceType) {
         //生成随机数
         String random = userId + deviceType + UUID.randomUUID().toString() + System.currentTimeMillis();
+        String charsetName = "UTF-8";
         //创建token
-        try {
-            return MD5Utils.md5Hex(MD5Utils.md5Hex(random.getBytes()).getBytes());
-        } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
-            throw new BaseException("生成token异常");
-        }
+        return MD5Util.MD5Encode(MD5Util.MD5Encode(random, charsetName), charsetName);
     }
 
     /**

+ 1 - 1
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/WordCheckServiceImpl.java

@@ -1,7 +1,7 @@
 package com.zanxiang.sdk.service.Impl;
 
-import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.mybatis.entity.WordCheck;
 import com.zanxiang.mybatis.mapper.WordCheckMapper;