소스 검색

fix : 小游戏玩家导量到H5游戏2

bilingfeng 1 년 전
부모
커밋
8f1b2b6715

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -21,7 +21,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, 小游戏玩家导量到H5游戏1> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, 小游戏玩家导量到H5游戏2> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

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

@@ -87,6 +87,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         if (user == null) {
             throw new BaseException("参数错误, 用户信息不存在");
         }
+        //判断手机号是否被该游戏其他用户绑定
+        int count = super.count(new LambdaQueryWrapper<User>()
+                .eq(User::getGameId, user.getGameId())
+                .eq(User::getMobile, mobile));
+        if (count > 0) {
+            throw new BaseException("参数错误, 该手机号已被该游戏其他玩家信息绑定");
+        }
         //查询H5游戏
         GameDTO h5GameDTO = gameService.getById(gameService.getById(user.getGameId()).getH5GameId());
         if (h5GameDTO == null) {