Parcourir la source

Merge remote-tracking branch 'origin/package' into package

lth il y a 1 an
Parent
commit
dd627b727a

+ 4 - 12
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/OssController.java

@@ -2,8 +2,6 @@ package com.zanxiang.game.module.manage.controller;
 
 import com.zanxiang.erp.security.annotation.PreAuthorize;
 import com.zanxiang.game.module.manage.enums.FileTypeEnum;
-import com.zanxiang.module.oss.pojo.OssUploadCallback;
-import com.zanxiang.module.oss.pojo.dto.OssUploadDTO;
 import com.zanxiang.module.oss.service.IOssService;
 import com.zanxiang.module.util.exception.BaseException;
 import com.zanxiang.module.util.pojo.ResultVO;
@@ -13,7 +11,10 @@ import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.Map;
 
@@ -42,13 +43,4 @@ public class OssController {
         }
         return ResultVO.ok(ossService.formUpload(fileTypeEnum.getFilePath(), type));
     }
-
-    @ApiOperation(value = "oss回传接口")
-    @PostMapping("/callback")
-    @PreAuthorize(permissionKey = "sdk:oss:callback")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = OssUploadCallback.class)})
-    public ResultVO<OssUploadCallback> ossCallback(@RequestBody OssUploadDTO dto) {
-        return ResultVO.ok(ossService.callback(dto));
-    }
-
 }

+ 38 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/api/OssCallBackApi.java

@@ -0,0 +1,38 @@
+package com.zanxiang.game.module.manage.controller.api;
+
+import com.zanxiang.module.oss.pojo.OssUploadCallback;
+import com.zanxiang.module.oss.pojo.dto.OssUploadDTO;
+import com.zanxiang.module.oss.service.IOssService;
+import com.zanxiang.module.util.pojo.ResultVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-06-27
+ * @description : oss回调api
+ */
+@Api(tags = {"oss相关接口管理"})
+@RestController
+@RequestMapping("/api/oss")
+@Slf4j
+public class OssCallBackApi {
+
+    @Autowired
+    private IOssService ossService;
+
+    @ApiOperation(value = "oss回传接口")
+    @PostMapping("/callback")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = OssUploadCallback.class)})
+    public ResultVO<OssUploadCallback> ossCallback(@RequestBody OssUploadDTO dto) {
+        return ResultVO.ok(ossService.callback(dto));
+    }
+}

+ 2 - 2
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameAddParam.java

@@ -55,7 +55,7 @@ public class GameAddParam {
      */
     @NotEmpty(message = "游戏分类不可为空")
     @ApiModelProperty(notes = "游戏分类, 可多选, 至少选一个")
-    private List<Long> classifyList;
+    private List<Long> tagIdList;
 
     /**
      * 游戏应用类型
@@ -86,7 +86,7 @@ public class GameAddParam {
      * 游戏描述
      */
     @ApiModelProperty(notes = "游戏描述(选填)")
-    private String description;
+    private String remark;
 
     /**
      * 小游戏/公众号应用信息

+ 7 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameListVO.java

@@ -60,7 +60,7 @@ public class GameListVO {
      * 游戏分类
      */
     @ApiModelProperty(notes = "游戏分类Id")
-    private String tags;
+    private List<Long> tagIdList;
 
     /**
      * 游戏分类名称列表
@@ -116,6 +116,12 @@ public class GameListVO {
     @ApiModelProperty(notes = "支付方式列表")
     private List<GamePayWayVO> gamePayWayList;
 
+    /**
+     * 游戏备注
+     */
+    @ApiModelProperty(notes = "游戏描述")
+    private String remark;
+
     /**
      * 上线状态1 接入中, 2 可上线, 3 已下线
      */

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

@@ -59,7 +59,7 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
     @Transactional(rollbackFor = Exception.class)
     public Boolean gameAddOrUpdate(GameAddParam param) {
         //游戏分类处理
-        String gameTags = this.getGameTags(param.getClassifyList());
+        String gameTags = this.getGameTags(param.getTagIdList());
         //主键id
         Long id = param.getId();
         Game game;
@@ -70,10 +70,10 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
                     .category(param.getCategory())
                     .tags(gameTags)
                     .status(GameStatusEnum.UN_JOIN_UP.getStatus())
-                    .description(param.getDescription())
                     .shareScale(param.getShareScale())
                     .h5GameId(param.getH5GameId())
                     .guideGameId(param.getGuideGameId())
+                    .remark(param.getRemark())
                     .createTime(LocalDateTime.now())
                     .updateTime(LocalDateTime.now())
                     .build();
@@ -85,7 +85,7 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
             game.setShareScale(param.getShareScale());
             game.setH5GameId(param.getH5GameId());
             game.setGuideGameId(param.getGuideGameId());
-            game.setDescription(param.getDescription());
+            game.setRemark(param.getRemark());
             game.setUpdateTime(LocalDateTime.now());
         }
         if (!Objects.equals(param.getIsParentGame(), Boolean.TRUE) && param.getParentGameId() != null) {
@@ -166,11 +166,15 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
             gameListVO.setCategoryName(GameCategoryEnum.getNameByCategory(gameListVO.getCategory()));
         }
         //游戏分类
-        if (Strings.isNotBlank(gameListVO.getTags())) {
-            List<Long> tagIdList = Arrays.stream(gameListVO.getTags().split(","))
+        if (Strings.isNotBlank(game.getTags())) {
+            List<Long> tagIdList = Arrays.stream(game.getTags().split(","))
                     .map(Long::parseLong).collect(Collectors.toList());
+            gameListVO.setTagIdList(tagIdList);
             gameListVO.setTagNameList(gameTagService.listByIds(tagIdList).stream()
                     .map(GameTag::getName).collect(Collectors.toList()));
+        } else {
+            gameListVO.setTagIdList(Collections.emptyList());
+            gameListVO.setTagNameList(Collections.emptyList());
         }
         //主游戏设置
         if (gameListVO.getParentId() != null) {
@@ -185,12 +189,12 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
         }
         //h5游戏
         if (gameListVO.getH5GameId() != null) {
-            Game h5Game = super.getById(gameListVO.getParentId());
+            Game h5Game = super.getById(gameListVO.getH5GameId());
             gameListVO.setH5GameName(h5Game == null ? null : h5Game.getName());
         }
         //关联游戏
         if (gameListVO.getGuideGameId() != null) {
-            Game guideGame = super.getById(gameListVO.getParentId());
+            Game guideGame = super.getById(gameListVO.getGuideGameId());
             gameListVO.setGuideGameName(guideGame == null ? null : guideGame.getName());
         }
         //查询支付方式列表

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

@@ -52,12 +52,6 @@ public class Game implements Serializable {
      */
     private Integer status;
 
-    /**
-     * 游戏描述
-     */
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
-    private String description;
-
     /**
      * 分成比例
      */
@@ -81,6 +75,12 @@ public class Game implements Serializable {
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private Long guideGameId;
 
+    /**
+     * 游戏备注
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private String remark;
+
     /**
      * 1 删除  0 正常
      */