Browse Source

fix : 游戏SDK后台创建数源修改

bilingfeng 1 năm trước cách đây
mục cha
commit
0f1a643408

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

@@ -62,7 +62,6 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
                 .eq(GameApplet::getGameId, game.getId())
         );
         if (gameApplet == null) {
-            this.createActionSet(game.getCategory(), game.getIsPut(), gameAppletConfigDTO.getAppId(), game.getName());
             gameApplet = GameApplet.builder()
                     .gameId(game.getId())
                     .appId(gameAppletConfigDTO.getAppId())
@@ -95,6 +94,7 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
             gameApplet.setManager(gameAppletConfigDTO.getManager());
             gameApplet.setUpdateTime(LocalDateTime.now());
         }
+        this.createActionSet(game.getCategory(), game.getIsPut(), gameAppletConfigDTO.getAppId(), game.getName());
         return super.saveOrUpdate(gameApplet);
     }
 
@@ -112,7 +112,7 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
 
     private Boolean createActionSet(Long gameCategory, Boolean isPut, String appId, String gameName) {
         CreateUserActionSetRpcDTO actionSetRpcDTO = CreateUserActionSetRpcDTO.builder()
-                .appId(appId).type("WEB").name(gameName + "Web数据源").build();
+                .appId(appId).type("WEB").name(gameName + "Web数据源").unique(Boolean.TRUE).build();
         //小游戏和H5的类型才需要创建数据源
         List<Long> categoryList = Arrays.asList(GameCategoryEnum.CATEGORY_WX_APPLET.getId(), GameCategoryEnum.CATEGORY_H5.getId());
         //投放的游戏才需要设置数据源