浏览代码

Merge branch 'package' of GameCenter/game-center into dev

zhimo 1 年之前
父节点
当前提交
1caa9b4f97

+ 2 - 2
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameServiceImpl.java

@@ -172,8 +172,8 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
             Game parentGame = super.getById(gameListVO.getParentId());
             Game parentGame = super.getById(gameListVO.getParentId());
             if (parentGame != null) {
             if (parentGame != null) {
                 gameListVO.setIsParentGame(Boolean.FALSE);
                 gameListVO.setIsParentGame(Boolean.FALSE);
-                gameListVO.setParentId(game.getId());
-                gameListVO.setParentName(game.getName());
+                gameListVO.setParentId(parentGame.getId());
+                gameListVO.setParentName(parentGame.getName());
             }
             }
         } else {
         } else {
             gameListVO.setIsParentGame(Boolean.TRUE);
             gameListVO.setIsParentGame(Boolean.TRUE);

+ 12 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/vo/GameAppletVO.java

@@ -1,7 +1,10 @@
 package com.zanxiang.game.module.sdk.pojo.vo;
 package com.zanxiang.game.module.sdk.pojo.vo;
 
 
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 
 /**
 /**
  * @author : lingfeng
  * @author : lingfeng
@@ -9,6 +12,9 @@ import lombok.Data;
  * @description : 微信小游戏初始化
  * @description : 微信小游戏初始化
  */
  */
 @Data
 @Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
 public class GameAppletVO {
 public class GameAppletVO {
 
 
     /**
     /**
@@ -17,4 +23,10 @@ public class GameAppletVO {
     @ApiModelProperty(notes = "微信小游戏appId")
     @ApiModelProperty(notes = "微信小游戏appId")
     private String appId;
     private String appId;
 
 
+    /**
+     * 是否投放
+     */
+    @ApiModelProperty(notes = "是否投放")
+    private Boolean isPut;
+
 }
 }

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/AgentServiceImpl.java

@@ -53,7 +53,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         List<UserLoginLog> userLoginLogList = userLoginLogService.list(new LambdaQueryWrapper<UserLoginLog>()
         List<UserLoginLog> userLoginLogList = userLoginLogService.list(new LambdaQueryWrapper<UserLoginLog>()
                 .eq(UserLoginLog::getUserId, user.getId())
                 .eq(UserLoginLog::getUserId, user.getId())
                 .orderByDesc(UserLoginLog::getCreateTime)
                 .orderByDesc(UserLoginLog::getCreateTime)
-                .apply("limit 1"));
+                .last("limit 1"));
         if (CollectionUtils.isEmpty(userLoginLogList)) {
         if (CollectionUtils.isEmpty(userLoginLogList)) {
             return;
             return;
         }
         }

+ 9 - 4
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameAppletServiceImpl.java

@@ -3,6 +3,7 @@ package com.zanxiang.game.module.sdk.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.game.module.base.pojo.enums.HttpStatusEnum;
 import com.zanxiang.game.module.base.pojo.enums.HttpStatusEnum;
+import com.zanxiang.game.module.mybatis.entity.Game;
 import com.zanxiang.game.module.mybatis.entity.GameApplet;
 import com.zanxiang.game.module.mybatis.entity.GameApplet;
 import com.zanxiang.game.module.mybatis.entity.Order;
 import com.zanxiang.game.module.mybatis.entity.Order;
 import com.zanxiang.game.module.mybatis.mapper.GameAppletMapper;
 import com.zanxiang.game.module.mybatis.mapper.GameAppletMapper;
@@ -57,6 +58,9 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
     @Autowired
     @Autowired
     private IPayApplicationService payApplicationService;
     private IPayApplicationService payApplicationService;
 
 
+    @Autowired
+    private IGameService gameService;
+
     @Value("${payConfig.wxPay.customH5Url}")
     @Value("${payConfig.wxPay.customH5Url}")
     private String customH5Url;
     private String customH5Url;
 
 
@@ -183,9 +187,10 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
     public GameAppletVO gameAppletInit(UserData userData) {
     public GameAppletVO gameAppletInit(UserData userData) {
         GameApplet gameApplet = super.getOne(new LambdaQueryWrapper<GameApplet>()
         GameApplet gameApplet = super.getOne(new LambdaQueryWrapper<GameApplet>()
                 .eq(GameApplet::getGameId, userData.getGameId()));
                 .eq(GameApplet::getGameId, userData.getGameId()));
-        if (gameApplet == null) {
-            throw new BaseException("参数错误, 游戏小程序信息不存在");
-        }
-        return BeanUtil.copy(gameApplet, GameAppletVO.class);
+        Game game = gameService.getById(userData.getGameId());
+        return GameAppletVO.builder()
+                .appId(gameApplet == null ? null : gameApplet.getAppId())
+                .isPut(game.getParentId() == null)
+                .build();
     }
     }
 }
 }