feat: 修改部分标识符;添加数据库文件
This commit is contained in:
parent
a4211463ca
commit
df4a9c3b5e
|
@ -57,12 +57,12 @@
|
|||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>org.springframework.boot</groupId> -->
|
||||
<!-- <artifactId>spring-boot-devtools</artifactId> -->
|
||||
<!-- <scope>runtime</scope> -->
|
||||
<!-- <optional>true</optional> -->
|
||||
<!-- </dependency> -->
|
||||
|
||||
<!-- quartz -->
|
||||
<dependency>
|
||||
|
|
|
@ -11,7 +11,7 @@ import jakarta.annotation.Resource;
|
|||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Tag(name = "系统配置", description = "系统配置相关接口")
|
||||
@Tag(name = "web配置", description = "web配置相关接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/config")
|
||||
public class ConfigurationController {
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.Map;
|
|||
* @author Bunny
|
||||
* @since 2024-09-28
|
||||
*/
|
||||
@Tag(name = "多语言", description = "多语言相关接口")
|
||||
@Tag(name = "i18n多语言", description = "i18n多语言相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/i18n")
|
||||
public class I18nController {
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||
* @author Bunny
|
||||
* @since 2024-09-28
|
||||
*/
|
||||
@Tag(name = "多语言类型", description = "多语言类型相关接口")
|
||||
@Tag(name = "i18n多语言类型", description = "i18n多语言类型相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/i18nType")
|
||||
public class I18nTypeController {
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.List;
|
|||
* @author Bunny
|
||||
* @since 2024-10-02 12:18:29
|
||||
*/
|
||||
@Tag(name = "系统菜单图标", description = "系统菜单图标相关接口")
|
||||
@Tag(name = "菜单图标", description = "菜单图标相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/menuIcon")
|
||||
public class MenuIconController {
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.List;
|
|||
* @author Bunny
|
||||
* @since 2024-10-18 12:56:39
|
||||
*/
|
||||
@Tag(name = "调度任务执行日志", description = "调度任务执行日志相关接口")
|
||||
@Tag(name = "任务调度执行日志", description = "调度任务执行日志相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/scheduleExecuteLog")
|
||||
public class ScheduleExecuteLogController {
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.List;
|
|||
* @author Bunny
|
||||
* @since 2024-10-19 01:01:01
|
||||
*/
|
||||
@Tag(name = "用户登录日志", description = "用户登录日志相关接口")
|
||||
@Tag(name = "系统用户登录日志", description = "用户登录日志相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/userLoginLog")
|
||||
public class UserLoginLogController {
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.util.Map;
|
|||
* @author Bunny
|
||||
* @since 2024-10-15 16:35:10
|
||||
*/
|
||||
@Tag(name = "调度任务", description = "调度任务相关接口")
|
||||
@Tag(name = "任务调度", description = "调度任务相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/schedulers")
|
||||
public class SchedulersController {
|
||||
|
|
|
@ -35,7 +35,7 @@ public class DeptController {
|
|||
@Resource
|
||||
private DeptService deptService;
|
||||
|
||||
@Operation(summary = "分页查询部门", description = "分页查询部门", tags = "schedulersGroup::query")
|
||||
@Operation(summary = "分页查询部门", description = "分页查询部门", tags = "dept::query")
|
||||
@GetMapping("{page}/{limit}")
|
||||
public Result<PageResult<DeptVo>> getDeptPage(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
|
@ -48,28 +48,28 @@ public class DeptController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@Operation(summary = "添加部门", description = "添加部门", tags = "schedulersGroup::add")
|
||||
@Operation(summary = "添加部门", description = "添加部门", tags = "dept::add")
|
||||
@PostMapping()
|
||||
public Result<String> addDept(@Valid @RequestBody DeptAddDto dto) {
|
||||
deptService.addDept(dto);
|
||||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新部门", description = "更新部门", tags = "schedulersGroup::update")
|
||||
@Operation(summary = "更新部门", description = "更新部门", tags = "dept::update")
|
||||
@PutMapping()
|
||||
public Result<String> updateDept(@Valid @RequestBody DeptUpdateDto dto) {
|
||||
deptService.updateDept(dto);
|
||||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除部门", description = "删除部门", tags = "schedulersGroup::delete")
|
||||
@Operation(summary = "删除部门", description = "删除部门", tags = "dept::delete")
|
||||
@DeleteMapping()
|
||||
public Result<String> deleteDept(@RequestBody List<Long> ids) {
|
||||
deptService.deleteDept(ids);
|
||||
return Result.success(ResultCodeEnum.DELETE_SUCCESS);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取所有部门", description = "获取所有部门", tags = "schedulersGroup::query")
|
||||
@Operation(summary = "获取所有部门", description = "获取所有部门", tags = "dept::query")
|
||||
@GetMapping("private/getDeptList")
|
||||
public Result<List<DeptVo>> getDeptPage() {
|
||||
List<DeptVo> voList = deptService.getDeptPage();
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Set;
|
|||
* @author Bunny
|
||||
* @since 2024-10-09 16:28:01
|
||||
*/
|
||||
@Tag(name = "系统文件表", description = "系统文件相关接口")
|
||||
@Tag(name = "系统文件", description = "系统文件相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/files")
|
||||
public class FilesController {
|
||||
|
|
|
@ -88,7 +88,7 @@ public class PermissionController {
|
|||
}
|
||||
|
||||
@Operation(summary = "获取所有权限", description = "获取所有权限", tags = {"permission::query"})
|
||||
@GetMapping("getPermissionList")
|
||||
@GetMapping("private/getPermissionList")
|
||||
public Result<List<PermissionVo>> getPermissionList() {
|
||||
List<PermissionVo> voList = permissionService.getPermissionList();
|
||||
return Result.success(voList);
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import java.util.List;
|
||||
|
||||
|
||||
@Tag(name = "用户信息", description = "用户信息相关接口")
|
||||
@Tag(name = "系统用户", description = "用户信息相关接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/user")
|
||||
public class UserController {
|
||||
|
|
|
@ -18,7 +18,7 @@ import java.util.List;
|
|||
* @author Bunny
|
||||
* @since 2024-09-26
|
||||
*/
|
||||
@Tag(name = "用户和角色", description = "用户和角色相关接口")
|
||||
@Tag(name = "系统用户和角色", description = "用户和角色相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/userRole")
|
||||
public class UserRoleController {
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.security.core.Authentication;
|
|||
import org.springframework.security.web.access.intercept.RequestAuthorizationContext;
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
@ -127,14 +128,17 @@ public class CustomAuthorizationManagerServiceImpl implements AuthorizationManag
|
|||
return permissionList.stream()
|
||||
// 过滤并转成小写进行比较
|
||||
.filter(permission -> {
|
||||
String lowerCase = permission.getRequestMethod().toLowerCase();
|
||||
String requestMethodLowerCase = requestMethod.toLowerCase();
|
||||
return lowerCase.equals(requestMethodLowerCase)
|
||||
|| requestURI.contains("/**");
|
||||
String permissionRequestMethod = permission.getRequestMethod();
|
||||
if (StringUtils.hasText(permissionRequestMethod)) {
|
||||
String lowerCase = permissionRequestMethod.toLowerCase();
|
||||
String requestMethodLowerCase = requestMethod.toLowerCase();
|
||||
return lowerCase.equals(requestMethodLowerCase)
|
||||
|| requestURI.contains("/**");
|
||||
}
|
||||
return false;
|
||||
})
|
||||
.map(Permission::getRequestUrl)
|
||||
.filter(Objects::nonNull)
|
||||
|
||||
.anyMatch(requestUrl -> {
|
||||
if ((requestUrl.contains("/*") || requestUrl.contains("/**"))) {
|
||||
return new AntPathRequestMatcher(requestUrl).matches(request);
|
||||
|
|
|
@ -217,6 +217,7 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
|
|||
* @param type 导出类型
|
||||
*/
|
||||
@Override
|
||||
@CacheEvict(cacheNames = "permission", key = "'permissionList'", beforeInvocation = true)
|
||||
public void importPermission(MultipartFile file, String type) {
|
||||
if (file == null) {
|
||||
throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
|
|
@ -126,7 +126,7 @@ public class PermissionUtil {
|
|||
*/
|
||||
public static boolean isPathAuthorized(String path) {
|
||||
if (!StringUtils.hasText(path)) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// 需要登录的路径模式检查
|
||||
|
|
|
@ -30,25 +30,26 @@ class TestControllerTest {
|
|||
permission.setPowerName(parent.getSummary());
|
||||
permission.setRequestUrl(parentPath);
|
||||
permissionService.saveOrUpdate(permission);
|
||||
// System.out.println(permission);
|
||||
|
||||
List<Permission> permissionList = parent.getChildren().stream()
|
||||
.map(children -> {
|
||||
String childrenPath = children.getPath();
|
||||
String requestMethod = children.getHttpMethod();
|
||||
|
||||
Permission childrenPermission = new Permission();
|
||||
childrenPermission.setParentId(permission.getId());
|
||||
childrenPermission.setPowerName(children.getSummary());
|
||||
if (!children.getPowerCodes().isEmpty()) {
|
||||
String ChildrenPowerCode = children.getPowerCodes().get(0);
|
||||
childrenPermission.setPowerCode(ChildrenPowerCode);
|
||||
|
||||
}
|
||||
|
||||
String childrenPath = children.getPath();
|
||||
childrenPermission.setRequestUrl(childrenPath);
|
||||
childrenPermission.setRequestMethod(requestMethod);
|
||||
childrenPermission.setRequestMethod(children.getHttpMethod());
|
||||
|
||||
return childrenPermission;
|
||||
}).toList();
|
||||
})
|
||||
.toList();
|
||||
// System.out.println(JSON.toJSONString(permissionList));
|
||||
permissionService.saveOrUpdateBatch(permissionList);
|
||||
});
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,18 +1,15 @@
|
|||
package cn.bunny.domain.system.entity.router;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(name = "RouterMeta对象", title = "系统菜单属性", description = "系统菜单属性")
|
||||
public class RouterMeta {
|
||||
|
||||
@Schema(name = "title", title = "路由title")
|
||||
|
|
|
@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "RouterMetaTransition对象", title = "系统菜单动画属性", description = "系统菜单动画属性")
|
||||
public class RouterMetaTransition {
|
||||
|
||||
@Schema(name = "enterTransition", title = "入场动画")
|
||||
|
|
Loading…
Reference in New Issue