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