mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-08 12:57:13 +08:00
build: continew-starter 2.13.3 => 2.13.4
1.移除 continew-starter-security-password 模块依赖及相关配置(已融合到 security-crypto 模块) 2.更新 continew-starter-security-crypto 模块配置 3.BaseController 增加跳过 DICT、DICT_TREE 接口权限处理 4.EnableCrudRestController => EnableCrudApi 5.调整 CRUD 相关 Controller API 接口配置,增加 DICT 或 DICT_TREE 接口,移除原 CommonController 接口
This commit is contained in:
@@ -38,7 +38,7 @@ public class DictApiImpl implements DictApi {
|
||||
|
||||
@Override
|
||||
public List<LabelValueResp> listAll() {
|
||||
List<LabelValueResp> list = baseService.listDict(null, null);
|
||||
List<LabelValueResp> list = baseService.dict(null, null);
|
||||
list.addAll(baseService.listEnumDict());
|
||||
return list;
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package top.continew.admin.system.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alicp.jetcache.anno.Cached;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -32,11 +31,10 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import top.continew.admin.common.constant.CacheConstants;
|
||||
import top.continew.admin.system.enums.OptionCategoryEnum;
|
||||
import top.continew.admin.system.model.query.*;
|
||||
import top.continew.admin.system.model.query.OptionQuery;
|
||||
import top.continew.admin.system.model.resp.file.FileUploadResp;
|
||||
import top.continew.admin.system.service.*;
|
||||
import top.continew.starter.core.util.validation.ValidationUtils;
|
||||
import top.continew.starter.extension.crud.model.query.SortQuery;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.extension.tenant.annotation.TenantIgnore;
|
||||
import top.continew.starter.extension.tenant.context.TenantContextHolder;
|
||||
@@ -60,10 +58,6 @@ import java.util.List;
|
||||
public class CommonController {
|
||||
|
||||
private final FileService fileService;
|
||||
private final DeptService deptService;
|
||||
private final MenuService menuService;
|
||||
private final UserService userService;
|
||||
private final RoleService roleService;
|
||||
private final DictItemService dictItemService;
|
||||
private final OptionService optionService;
|
||||
|
||||
@@ -82,30 +76,6 @@ public class CommonController {
|
||||
.build();
|
||||
}
|
||||
|
||||
@Operation(summary = "查询部门树", description = "查询树结构的部门列表")
|
||||
@GetMapping("/tree/dept")
|
||||
public List<Tree<Long>> listDeptTree(DeptQuery query, SortQuery sortQuery) {
|
||||
return deptService.tree(query, sortQuery, true);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询菜单树", description = "查询树结构的菜单列表")
|
||||
@GetMapping("/tree/menu")
|
||||
public List<Tree<Long>> listMenuTree(MenuQuery query, SortQuery sortQuery) {
|
||||
return menuService.tree(query, sortQuery, true);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询用户字典", description = "查询用户字典列表")
|
||||
@GetMapping("/dict/user")
|
||||
public List<LabelValueResp> listUserDict(UserQuery query, SortQuery sortQuery) {
|
||||
return userService.listDict(query, sortQuery);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询角色字典", description = "查询角色字典列表")
|
||||
@GetMapping("/dict/role")
|
||||
public List<LabelValueResp> listRoleDict(RoleQuery query, SortQuery sortQuery) {
|
||||
return roleService.listDict(query, sortQuery);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询字典", description = "查询字典列表")
|
||||
@Parameter(name = "code", description = "字典编码", example = "notice_type", in = ParameterIn.PATH)
|
||||
@GetMapping("/dict/{code}")
|
||||
|
@@ -35,6 +35,6 @@ import top.continew.starter.extension.crud.enums.Api;
|
||||
@Tag(name = "部门管理 API")
|
||||
@RestController
|
||||
@CrudRequestMapping(value = "/system/dept", api = {Api.TREE, Api.GET, Api.CREATE, Api.UPDATE, Api.BATCH_DELETE,
|
||||
Api.EXPORT})
|
||||
Api.EXPORT, Api.DICT_TREE})
|
||||
public class DeptController extends BaseController<DeptService, DeptResp, DeptResp, DeptQuery, DeptReq> {
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ import java.util.List;
|
||||
@Tag(name = "菜单管理 API")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@CrudRequestMapping(value = "/system/menu", api = {Api.TREE, Api.GET, Api.CREATE, Api.UPDATE, Api.BATCH_DELETE})
|
||||
@CrudRequestMapping(value = "/system/menu", api = {Api.TREE, Api.GET, Api.CREATE, Api.UPDATE, Api.BATCH_DELETE, Api.DICT_TREE})
|
||||
public class MenuController extends BaseController<MenuService, MenuResp, MenuResp, MenuQuery, MenuReq> {
|
||||
|
||||
private final MenuService menuService;
|
||||
|
@@ -53,7 +53,7 @@ import java.util.List;
|
||||
@Validated
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@CrudRequestMapping(value = "/system/role", api = {Api.LIST, Api.GET, Api.CREATE, Api.UPDATE, Api.BATCH_DELETE})
|
||||
@CrudRequestMapping(value = "/system/role", api = {Api.LIST, Api.GET, Api.CREATE, Api.UPDATE, Api.BATCH_DELETE, Api.DICT})
|
||||
public class RoleController extends BaseController<RoleService, RoleResp, RoleDetailResp, RoleQuery, RoleReq> {
|
||||
|
||||
private final UserRoleService userRoleService;
|
||||
|
@@ -59,7 +59,7 @@ import java.io.IOException;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@CrudRequestMapping(value = "/system/user", api = {Api.PAGE, Api.LIST, Api.GET, Api.CREATE, Api.UPDATE,
|
||||
Api.BATCH_DELETE, Api.EXPORT})
|
||||
Api.BATCH_DELETE, Api.EXPORT, Api.DICT})
|
||||
public class UserController extends BaseController<UserService, UserResp, UserDetailResp, UserQuery, UserReq> {
|
||||
|
||||
@Override
|
||||
|
@@ -134,9 +134,9 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, RoleDO, RoleRes
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LabelValueResp> listDict(RoleQuery query, SortQuery sortQuery) {
|
||||
public List<LabelValueResp> dict(RoleQuery query, SortQuery sortQuery) {
|
||||
query.setExcludeRoleCodes(RoleCodeEnum.getSuperRoleCodes());
|
||||
return super.listDict(query, sortQuery);
|
||||
return super.dict(query, sortQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user