|
@@ -3,6 +3,7 @@ package com.zanxiang.game.module.sdk.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
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.Order;
|
|
|
import com.zanxiang.game.module.mybatis.mapper.GameAppletMapper;
|
|
@@ -57,6 +58,9 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
|
|
|
@Autowired
|
|
|
private IPayApplicationService payApplicationService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IGameService gameService;
|
|
|
+
|
|
|
@Value("${payConfig.wxPay.customH5Url}")
|
|
|
private String customH5Url;
|
|
|
|
|
@@ -183,9 +187,10 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
|
|
|
public GameAppletVO gameAppletInit(UserData userData) {
|
|
|
GameApplet gameApplet = super.getOne(new LambdaQueryWrapper<GameApplet>()
|
|
|
.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();
|
|
|
}
|
|
|
}
|