Skip to content

Commit 2bb2f96

Browse files
authored
refactor: 增加租户查询条件 (#181)
1 parent df6e294 commit 2bb2f96

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

continew-common/src/main/java/top/continew/admin/common/api/system/MenuApi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public interface MenuApi {
3232
* 查询树结构列表
3333
*
3434
* @param excludeMenuIds 排除的菜单 ID 列表
35+
* @param isSimple 是否是简单树结构
3536
* @return 树结构列表
3637
*/
37-
List<Tree<Long>> listTree(List<Long> excludeMenuIds);
38+
List<Tree<Long>> listTree(List<Long> excludeMenuIds, boolean isSimple);
3839
}

continew-plugin/continew-plugin-tenant/src/main/java/top/continew/admin/tenant/controller/PackageController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import io.swagger.v3.oas.annotations.tags.Tag;
2323
import lombok.RequiredArgsConstructor;
2424
import org.springframework.web.bind.annotation.GetMapping;
25+
import org.springframework.web.bind.annotation.RequestParam;
2526
import org.springframework.web.bind.annotation.RestController;
2627
import top.continew.admin.common.api.system.MenuApi;
2728
import top.continew.admin.common.base.controller.BaseController;
@@ -56,7 +57,7 @@ public class PackageController extends BaseController<PackageService, PackageRes
5657
@Operation(summary = "查询租户套餐菜单", description = "查询租户套餐菜单树列表")
5758
@SaCheckPermission("tenant:package:list")
5859
@GetMapping("/menu/tree")
59-
public List<Tree<Long>> listMenuTree() {
60-
return menuApi.listTree(tenantExtensionProperties.getIgnoreMenus());
60+
public List<Tree<Long>> listMenuTree(@RequestParam(required = false, defaultValue = "true") Boolean isSimple) {
61+
return menuApi.listTree(tenantExtensionProperties.getIgnoreMenus(), isSimple);
6162
}
6263
}

continew-plugin/continew-plugin-tenant/src/main/java/top/continew/admin/tenant/model/query/TenantQuery.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ public class TenantQuery implements Serializable {
4545
@Query(columns = {"name", "description"}, type = QueryType.LIKE)
4646
private String description;
4747

48+
/**
49+
* 编码
50+
*/
51+
@Schema(description = "编码", example = "T0stxiJK6RMH")
52+
@Query(type = QueryType.EQ)
53+
private String code;
54+
55+
/**
56+
* 域名
57+
*/
58+
@Schema(description = "域名", example = "admin.continew.top")
59+
@Query(type = QueryType.LIKE)
60+
private String domain;
61+
4862
/**
4963
* 套餐 ID
5064
*/

continew-system/src/main/java/top/continew/admin/system/api/MenuApiImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public class MenuApiImpl implements MenuApi {
3939
private final MenuService baseService;
4040

4141
@Override
42-
public List<Tree<Long>> listTree(List<Long> excludeMenuIds) {
42+
public List<Tree<Long>> listTree(List<Long> excludeMenuIds, boolean isSimple) {
4343
MenuQuery query = new MenuQuery();
4444
query.setStatus(DisEnableStatusEnum.ENABLE);
4545
// 过滤掉租户不能使用的菜单
4646
query.setExcludeMenuIdList(excludeMenuIds);
47-
return baseService.tree(query, null, true);
47+
return baseService.tree(query, null, isSimple);
4848
}
4949
}

0 commit comments

Comments
 (0)