Browse Source

feat:1、游戏帮派下拉框列表

zhangxianyu 1 month ago
parent
commit
92653c7b9d

+ 2 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/RoleManageController.java

@@ -70,8 +70,8 @@ public class RoleManageController {
     @ApiOperation(value = "游戏帮派列表")
     @PreAuthorize(permissionKey = "roleManage:gameCountry:list")
     @PostMapping("/gameCountryList")
-    public ResultVO<List<String>> gameCountryList() {
-        return ResultVO.ok(roleManageService.gameCountryList());
+    public ResultVO<List<Map>> gameCountryList(@RequestBody GameCountryParamDTO dto) {
+        return ResultVO.ok(roleManageService.gameCountryList(dto));
     }
 
     @ApiOperation(value = "游戏帮派数据列表")

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IRoleManageService.java

@@ -76,5 +76,5 @@ public interface IRoleManageService {
      * 游戏帮派列表
      * @return
      */
-    List<String> gameCountryList();
+    List<Map> gameCountryList(GameCountryParamDTO dto);
 }

+ 14 - 7
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/RoleManageServiceImpl.java

@@ -1047,19 +1047,26 @@ public class RoleManageServiceImpl implements IRoleManageService {
     }
 
     @Override
-    public List<String> gameCountryList() {
-        String countryListSql = getCountryListSql();
+    public List<Map> gameCountryList(GameCountryParamDTO dto) {
+        Criteria cri = Cnd.cri();
+        if(CollectionUtils.isNotEmpty(dto.getServerId())){
+            cri.where().andInStrList("server_id",dto.getServerId());
+        }
+        if(CollectionUtils.isNotEmpty(dto.getGameId())){
+            cri.where().andInList("parent_game_id",dto.getGameId());
+        }
+        String countryListSql = getCountryListSql(cri);
         Sql sql = Sqls.create(countryListSql);
-        sql.setCallback(Sqls.callback.strList());
+        sql.setCallback(Sqls.callback.maps());
         dao.execute(sql);
-        List<String> list = sql.getList(String.class);
+        List<Map> list = sql.getList(Map.class);
         return list;
     }
 
-    private String getCountryListSql() {
+    private String getCountryListSql(Criteria criteria) {
         return """
-                select country from dm_game_order.t_server_country
-                """;
+                select country,server_id from dm_game_order.t_server_country
+                """ + criteria;
     }
 
     private String getGameCountryRoleListSql(Criteria criA) {