浏览代码

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

zhimo 1 年之前
父节点
当前提交
9f973f11e3
共有 14 个文件被更改,包括 192 次插入158 次删除
  1. 24 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/dto/GameAppletConfigDTO.java
  2. 36 4
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/dto/GameAppletDTO.java
  3. 11 2
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameAppletService.java
  4. 65 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameAppletServiceImpl.java
  5. 13 5
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameServiceImpl.java
  6. 15 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameApplet.java
  7. 0 71
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GamePicture.java
  8. 5 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/User.java
  9. 0 12
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/mapper/GamePictureMapper.java
  10. 15 3
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/dto/GameAppletDTO.java
  11. 0 21
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/IGamePictureService.java
  12. 0 33
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GamePictureServiceImpl.java
  13. 1 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/LoginServiceImpl.java
  14. 7 7
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserShareServiceImpl.java

+ 24 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/dto/GameAppletConfigDTO.java

@@ -17,6 +17,12 @@ import lombok.NoArgsConstructor;
 @Builder
 @Builder
 public class GameAppletConfigDTO {
 public class GameAppletConfigDTO {
 
 
+    /**
+     * 类型,1 : 小程序, 2 : 公众号
+     */
+    @ApiModelProperty(notes = "类型,1 : 小程序, 2 : 公众号 (必填)")
+    private Integer type;
+
     /**
     /**
      * 小游戏/公众号应用id
      * 小游戏/公众号应用id
      */
      */
@@ -41,6 +47,24 @@ public class GameAppletConfigDTO {
     @ApiModelProperty(notes = "小游戏/公众号应用密钥 (必填)")
     @ApiModelProperty(notes = "小游戏/公众号应用密钥 (必填)")
     private String appSecret;
     private String appSecret;
 
 
+    /**
+     * 小游戏分享标题
+     */
+    @ApiModelProperty(notes = "小游戏分享标题, 游戏类型为小游戏时必填, 游戏为H5时不填")
+    private String shareTitle;
+
+    /**
+     * 小游戏分享路径
+     */
+    @ApiModelProperty(notes = "小游戏分享路径, 游戏类型为小游戏时必填, 游戏为H5时不填")
+    private String sharePath;
+
+    /**
+     * 小游戏分享图片
+     */
+    @ApiModelProperty(notes = "小游戏分享图片, 游戏类型为小游戏时必填, 游戏为H5时不填")
+    private String shareImg;
+
     /**
     /**
      * 公司主体信息
      * 公司主体信息
      */
      */

+ 36 - 4
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/dto/GameAppletDTO.java

@@ -2,6 +2,8 @@ package com.zanxiang.game.module.manage.pojo.dto;
 
 
 import lombok.Data;
 import lombok.Data;
 
 
+import java.time.LocalDateTime;
+
 /**
 /**
  * @author : lingfeng
  * @author : lingfeng
  * @time : 2023-02-14
  * @time : 2023-02-14
@@ -40,6 +42,11 @@ public class GameAppletDTO {
      */
      */
     private String appSecret;
     private String appSecret;
 
 
+    /**
+     * 类型,1 : 小程序, 2 : 公众号
+     */
+    private Integer type;
+
     /**
     /**
      * 米大师配置
      * 米大师配置
      */
      */
@@ -50,6 +57,21 @@ public class GameAppletDTO {
      */
      */
     private String msgConfig;
     private String msgConfig;
 
 
+    /**
+     * 分享标题
+     */
+    private String shareTitle;
+
+    /**
+     * 分享路径
+     */
+    private String sharePath;
+
+    /**
+     * 分享图片
+     */
+    private String shareImg;
+
     /**
     /**
      * 公司主体信息
      * 公司主体信息
      */
      */
@@ -71,12 +93,22 @@ public class GameAppletDTO {
     private String manager;
     private String manager;
 
 
     /**
     /**
-     * 管理员微信
+     * 备注
      */
      */
-    private String managerVx;
+    private String remark;
 
 
     /**
     /**
-     * 备注
+     * 状态, 0 正常, 1 不可用
      */
      */
-    private String remark;
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
 }
 }

+ 11 - 2
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameAppletService.java

@@ -1,9 +1,9 @@
 package com.zanxiang.game.module.manage.service;
 package com.zanxiang.game.module.manage.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.game.module.manage.pojo.dto.GameAppletConfigDTO;
 import com.zanxiang.game.module.manage.pojo.dto.GameAppletDTO;
 import com.zanxiang.game.module.manage.pojo.dto.GameAppletDTO;
-import com.zanxiang.game.module.manage.pojo.params.GameAccountUpdateParam;
-import com.zanxiang.game.module.manage.pojo.vo.GameAccountVO;
+import com.zanxiang.game.module.mybatis.entity.Game;
 import com.zanxiang.game.module.mybatis.entity.GameApplet;
 import com.zanxiang.game.module.mybatis.entity.GameApplet;
 
 
 /**
 /**
@@ -13,6 +13,15 @@ import com.zanxiang.game.module.mybatis.entity.GameApplet;
  */
  */
 public interface IGameAppletService extends IService<GameApplet> {
 public interface IGameAppletService extends IService<GameApplet> {
 
 
+    /**
+     * 添加或更新
+     *
+     * @param game                游戏
+     * @param gameAppletConfigDTO 游戏小程序配置dto
+     * @return boolean
+     */
+    boolean addOrUpdate(Game game, GameAppletConfigDTO gameAppletConfigDTO);
+
     /**
     /**
      * 通过游戏id
      * 通过游戏id
      *
      *

+ 65 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameAppletServiceImpl.java

@@ -4,8 +4,16 @@ import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONObject;
 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.advertising.tencent.base.AdvertisingTencentServer;
+import com.zanxiang.advertising.tencent.base.pojo.dto.CreateUserActionSetRpcDTO;
+import com.zanxiang.advertising.tencent.base.rpc.IUserActionSetRpc;
+import com.zanxiang.game.module.base.pojo.enums.DeleteEnum;
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
+import com.zanxiang.game.module.base.pojo.enums.StatusEnum;
+import com.zanxiang.game.module.manage.pojo.dto.GameAppletConfigDTO;
 import com.zanxiang.game.module.manage.pojo.dto.GameAppletDTO;
 import com.zanxiang.game.module.manage.pojo.dto.GameAppletDTO;
 import com.zanxiang.game.module.manage.service.IGameAppletService;
 import com.zanxiang.game.module.manage.service.IGameAppletService;
+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.mapper.GameAppletMapper;
 import com.zanxiang.game.module.mybatis.mapper.GameAppletMapper;
 import com.zanxiang.module.oss.service.IOssService;
 import com.zanxiang.module.oss.service.IOssService;
@@ -14,6 +22,7 @@ import com.zanxiang.module.util.URIUtil;
 import com.zanxiang.module.util.bean.BeanUtil;
 import com.zanxiang.module.util.bean.BeanUtil;
 import com.zanxiang.module.util.exception.BaseException;
 import com.zanxiang.module.util.exception.BaseException;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.logging.log4j.util.Strings;
 import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -22,8 +31,10 @@ import java.io.BufferedInputStream;
 import java.io.PrintWriter;
 import java.io.PrintWriter;
 import java.net.HttpURLConnection;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.net.URL;
+import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map;
+import java.util.Objects;
 import java.util.UUID;
 import java.util.UUID;
 
 
 /**
 /**
@@ -35,9 +46,63 @@ import java.util.UUID;
 @Service
 @Service
 public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApplet> implements IGameAppletService {
 public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApplet> implements IGameAppletService {
 
 
+    @DubboReference(providedBy = AdvertisingTencentServer.SERVER_DUBBO_NAME)
+    private IUserActionSetRpc userActionSetRpc;
+
     @Autowired
     @Autowired
     private IOssService ossService;
     private IOssService ossService;
 
 
+    @Override
+    public boolean addOrUpdate(Game game, GameAppletConfigDTO gameAppletConfigDTO) {
+        GameApplet gameApplet = super.getOne(new LambdaQueryWrapper<GameApplet>()
+                .eq(GameApplet::getAppId, gameAppletConfigDTO.getAppId()));
+        if (gameApplet == null) {
+            CreateUserActionSetRpcDTO actionSetRpcDTO = CreateUserActionSetRpcDTO.builder()
+                    .appId(gameAppletConfigDTO.getAppId())
+                    .build();
+            //小游戏需要创建数据源
+            if (Objects.equals(GameCategoryEnum.CATEGORY_WX_APPLET.getCategory(), game.getCategory())) {
+//                userActionSetRpc.create(actionSetRpcDTO);
+            }
+            //H5游戏要判断是否主游戏, 主游戏才投, 需要创建公众号数据源
+            if (game.getParentId() == null && Objects.equals(GameCategoryEnum.CATEGORY_H5.getCategory(), game.getCategory())) {
+//                userActionSetRpc.create(actionSetRpcDTO);
+            }
+            gameApplet = GameApplet.builder()
+                    .gameId(game.getId())
+                    .appId(gameAppletConfigDTO.getAppId())
+                    .ghId(gameAppletConfigDTO.getGhId())
+                    .appName(gameAppletConfigDTO.getAppName())
+                    .appSecret(gameAppletConfigDTO.getAppSecret())
+                    .type(gameAppletConfigDTO.getType())
+                    .shareTitle(gameAppletConfigDTO.getShareTitle())
+                    .sharePath(gameAppletConfigDTO.getSharePath())
+                    .shareImg(gameAppletConfigDTO.getShareImg())
+                    .company(gameAppletConfigDTO.getCompany())
+                    .account(gameAppletConfigDTO.getAccount())
+                    .manager(gameAppletConfigDTO.getManager())
+                    .isDelete(DeleteEnum.NO.getCode())
+                    .status(StatusEnum.YES.getCode())
+                    .createTime(LocalDateTime.now())
+                    .updateTime(LocalDateTime.now())
+                    .build();
+        } else {
+            gameApplet.setAppId(gameAppletConfigDTO.getAppId());
+            gameApplet.setGhId(gameAppletConfigDTO.getGhId());
+            gameApplet.setAppName(gameAppletConfigDTO.getAppName());
+            gameApplet.setAppSecret(gameAppletConfigDTO.getAppSecret());
+            gameApplet.setType(gameAppletConfigDTO.getType());
+            gameApplet.setShareTitle(gameAppletConfigDTO.getShareTitle());
+            gameApplet.setSharePath(gameAppletConfigDTO.getSharePath());
+            gameApplet.setShareImg(gameAppletConfigDTO.getShareImg());
+            gameApplet.setCompany(gameAppletConfigDTO.getCompany());
+            gameApplet.setAccount(gameAppletConfigDTO.getAccount());
+            gameApplet.setManager(gameAppletConfigDTO.getManager());
+            gameApplet.setUpdateTime(LocalDateTime.now());
+        }
+       return super.saveOrUpdate(gameApplet);
+    }
+
     @Override
     @Override
     public GameAppletDTO getByGameId(Long gameId) {
     public GameAppletDTO getByGameId(Long gameId) {
         GameApplet gameApplet = super.getOne(new LambdaQueryWrapper<GameApplet>()
         GameApplet gameApplet = super.getOne(new LambdaQueryWrapper<GameApplet>()

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

@@ -7,16 +7,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.manage.enums.GameStatusEnum;
 import com.zanxiang.game.module.manage.enums.GameStatusEnum;
+import com.zanxiang.game.module.manage.pojo.dto.GameAppletConfigDTO;
+import com.zanxiang.game.module.manage.pojo.dto.GameAppletDTO;
 import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
 import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
 import com.zanxiang.game.module.manage.pojo.params.GameAddParam;
 import com.zanxiang.game.module.manage.pojo.params.GameAddParam;
 import com.zanxiang.game.module.manage.pojo.params.GameListParam;
 import com.zanxiang.game.module.manage.pojo.params.GameListParam;
 import com.zanxiang.game.module.manage.pojo.vo.GameChoiceVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameChoiceVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameInfoVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameInfoVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameListVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameListVO;
-import com.zanxiang.game.module.manage.service.ICpService;
-import com.zanxiang.game.module.manage.service.IGamePayWayService;
-import com.zanxiang.game.module.manage.service.IGameService;
-import com.zanxiang.game.module.manage.service.IGameTagService;
+import com.zanxiang.game.module.manage.service.*;
 import com.zanxiang.game.module.mybatis.entity.Cp;
 import com.zanxiang.game.module.mybatis.entity.Cp;
 import com.zanxiang.game.module.mybatis.entity.Game;
 import com.zanxiang.game.module.mybatis.entity.Game;
 import com.zanxiang.game.module.mybatis.entity.GameTag;
 import com.zanxiang.game.module.mybatis.entity.GameTag;
@@ -53,6 +52,9 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
     @Autowired
     @Autowired
     private ICpService cpService;
     private ICpService cpService;
 
 
+    @Autowired
+    private IGameAppletService gameAppletService;
+
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public Boolean gameAddOrUpdate(GameAddParam param) {
     public Boolean gameAddOrUpdate(GameAddParam param) {
@@ -89,7 +91,8 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
         if (!Objects.equals(param.getIsParentGame(), Boolean.TRUE) && param.getParentGameId() != null) {
         if (!Objects.equals(param.getIsParentGame(), Boolean.TRUE) && param.getParentGameId() != null) {
             game.setParentId(param.getParentGameId());
             game.setParentId(param.getParentGameId());
         }
         }
-        return super.saveOrUpdate(game);
+        super.saveOrUpdate(game);
+        return gameAppletService.addOrUpdate(game, param.getGameAppletConfigDTO());
     }
     }
 
 
     private String getGameTags(List<Long> tagIdList) {
     private String getGameTags(List<Long> tagIdList) {
@@ -192,6 +195,11 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
         }
         }
         //查询支付方式列表
         //查询支付方式列表
         gameListVO.setGamePayWayList(gamePayWayService.getByGameId(game.getId()));
         gameListVO.setGamePayWayList(gamePayWayService.getByGameId(game.getId()));
+        //游戏应用信息
+        GameAppletDTO gameAppletDTO = gameAppletService.getByGameId(game.getId());
+        if (gameAppletDTO != null) {
+            gameListVO.setGameAppletConfigDTO(BeanUtil.copy(gameAppletDTO, GameAppletConfigDTO.class));
+        }
         return gameListVO;
         return gameListVO;
     }
     }
 
 

+ 15 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameApplet.java

@@ -70,6 +70,21 @@ public class GameApplet implements Serializable {
      */
      */
     private String msgConfig;
     private String msgConfig;
 
 
+    /**
+     * 分享标题
+     */
+    private String shareTitle;
+
+    /**
+     * 分享路径
+     */
+    private String sharePath;
+
+    /**
+     * 分享图片
+     */
+    private String shareImg;
+
     /**
     /**
      * 公司主体信息
      * 公司主体信息
      */
      */

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

@@ -1,71 +0,0 @@
-package com.zanxiang.game.module.mybatis.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.*;
-
-import java.io.Serializable;
-import java.time.LocalDateTime;
-
-/**
- * @author : lingfeng
- * @time : 2022-07-12
- * @description : 游戏图片
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@ToString
-@Builder
-@TableName("t_game_picture")
-public class GamePicture implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 游戏id
-     */
-    private Long gameId;
-
-    /**
-     * 游戏头像
-     */
-    private String avatarImg;
-
-    /**
-     * 小程序码图片
-     */
-    private String appletImg;
-
-    /**
-     * 分享标题
-     */
-    private String shareTitle;
-
-    /**
-     * 分享路径
-     */
-    private String sharePath;
-
-    /**
-     * 分享图片
-     */
-    private String shareImg;
-
-    /**
-     * 创建时间
-     */
-    private LocalDateTime createTime;
-
-    /**
-     * 更新时间
-     */
-    private LocalDateTime updateTime;
-}

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

@@ -131,6 +131,11 @@ public class User implements Serializable {
      */
      */
     private String deviceSystem;
     private String deviceSystem;
 
 
+    /**
+     * 渠道参数
+     */
+    private String channel;
+
     /**
     /**
      * 用户注册ip
      * 用户注册ip
      */
      */

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

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

+ 15 - 3
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/dto/GameAppletDTO.java

@@ -1,7 +1,5 @@
 package com.zanxiang.game.module.sdk.pojo.dto;
 package com.zanxiang.game.module.sdk.pojo.dto;
 
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.zanxiang.module.util.JsonUtil;
 import com.zanxiang.module.util.JsonUtil;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Builder;
@@ -23,7 +21,6 @@ public class GameAppletDTO {
     /**
     /**
      * 主键
      * 主键
      */
      */
-    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
     private Long id;
 
 
     /**
     /**
@@ -66,6 +63,21 @@ public class GameAppletDTO {
      */
      */
     private String msgConfig;
     private String msgConfig;
 
 
+    /**
+     * 分享标题
+     */
+    private String shareTitle;
+
+    /**
+     * 分享路径
+     */
+    private String sharePath;
+
+    /**
+     * 分享图片
+     */
+    private String shareImg;
+
     /**
     /**
      * 获取米大师支付配置Bean
      * 获取米大师支付配置Bean
      *
      *

+ 0 - 21
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/IGamePictureService.java

@@ -1,21 +0,0 @@
-package com.zanxiang.game.module.sdk.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.zanxiang.game.module.mybatis.entity.GamePicture;
-import com.zanxiang.game.module.sdk.pojo.dto.GamePictureDTO;
-
-/**
- * @author : lingfeng
- * @time : 2022-07-12
- * @description : 游戏图片
- */
-public interface IGamePictureService extends IService<GamePicture> {
-
-    /**
-     * 通过游戏id
-     *
-     * @param gameId 游戏id
-     * @return {@link GamePictureDTO}
-     */
-    GamePictureDTO getByGameId(Long gameId);
-}

+ 0 - 33
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GamePictureServiceImpl.java

@@ -1,33 +0,0 @@
-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.mybatis.entity.GamePicture;
-import com.zanxiang.game.module.mybatis.mapper.GamePictureMapper;
-import com.zanxiang.game.module.sdk.pojo.dto.GamePictureDTO;
-import com.zanxiang.game.module.sdk.service.IGamePictureService;
-import com.zanxiang.module.util.bean.BeanUtil;
-import com.zanxiang.module.util.exception.BaseException;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * @author : lingfeng
- * @time : 2022-07-12
- * @description : 游戏图片
- */
-@Slf4j
-@Service
-public class GamePictureServiceImpl extends ServiceImpl<GamePictureMapper, GamePicture> implements IGamePictureService {
-
-    @Override
-    public GamePictureDTO getByGameId(Long gameId) {
-        GamePicture gamePicture = super.getOne(new LambdaQueryWrapper<GamePicture>()
-                .eq(GamePicture::getGameId, gameId));
-        if (gamePicture == null) {
-            log.error("参数错误, 游戏图片信息不存在, gameId : {}", gameId);
-            throw new BaseException("参数错误, 游戏图片信息不存在");
-        }
-        return BeanUtil.copy(gamePicture, GamePictureDTO.class);
-    }
-}

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

@@ -220,6 +220,7 @@ public class LoginServiceImpl implements IRegisterLoginService {
         user.setMobile(mobile);
         user.setMobile(mobile);
         user.setOpenId(openId);
         user.setOpenId(openId);
         user.setSessionKey(sessionKey);
         user.setSessionKey(sessionKey);
+        user.setChannel(userData.getChannel());
         userService.save(user);
         userService.save(user);
         gameUserService.createGameUser(user);
         gameUserService.createGameUser(user);
         callBackService.userCallBack(user, tuple2);
         callBackService.userCallBack(user, tuple2);

+ 7 - 7
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserShareServiceImpl.java

@@ -3,10 +3,10 @@ package com.zanxiang.game.module.sdk.service.impl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.game.module.mybatis.entity.UserShare;
 import com.zanxiang.game.module.mybatis.entity.UserShare;
 import com.zanxiang.game.module.mybatis.mapper.UserShareMapper;
 import com.zanxiang.game.module.mybatis.mapper.UserShareMapper;
-import com.zanxiang.game.module.sdk.pojo.dto.GamePictureDTO;
+import com.zanxiang.game.module.sdk.pojo.dto.GameAppletDTO;
 import com.zanxiang.game.module.sdk.pojo.param.UserData;
 import com.zanxiang.game.module.sdk.pojo.param.UserData;
 import com.zanxiang.game.module.sdk.pojo.vo.GameShareVO;
 import com.zanxiang.game.module.sdk.pojo.vo.GameShareVO;
-import com.zanxiang.game.module.sdk.service.IGamePictureService;
+import com.zanxiang.game.module.sdk.service.IGameAppletService;
 import com.zanxiang.game.module.sdk.service.IUserShareService;
 import com.zanxiang.game.module.sdk.service.IUserShareService;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,18 +22,18 @@ import org.springframework.stereotype.Service;
 public class UserShareServiceImpl extends ServiceImpl<UserShareMapper, UserShare> implements IUserShareService {
 public class UserShareServiceImpl extends ServiceImpl<UserShareMapper, UserShare> implements IUserShareService {
 
 
     @Autowired
     @Autowired
-    private IGamePictureService gamePictureService;
+    private IGameAppletService gameAppletService;
 
 
     @Override
     @Override
     public GameShareVO getGameShare(UserData userData) {
     public GameShareVO getGameShare(UserData userData) {
-        GamePictureDTO gamePictureDTO = gamePictureService.getByGameId(userData.getGameId());
-        String path = gamePictureDTO.getSharePath();
+        GameAppletDTO gameAppletDTO = gameAppletService.getByGameId(userData.getGameId());
+        String path = gameAppletDTO.getSharePath();
         if (userData.getUserId() != null) {
         if (userData.getUserId() != null) {
             path = path + "?shareUserId=" + userData.getUserId();
             path = path + "?shareUserId=" + userData.getUserId();
         }
         }
         return GameShareVO.builder()
         return GameShareVO.builder()
-                .title(gamePictureDTO.getShareTitle())
-                .shareImg(gamePictureDTO.getShareImg())
+                .title(gameAppletDTO.getShareTitle())
+                .shareImg(gameAppletDTO.getShareImg())
                 .path(path)
                 .path(path)
                 .build();
                 .build();
     }
     }