refactor(system): 调整系统配置接口权限控制和路由- 为 page 方法添加 @PreAuthorize 注解,控制查询权限- 将 refreshCache 方法的 HTTP 方法从 @PatchMapping 改为 @PutMapping
- 为 update 和 delete 方法添加缺失的 @PreAuthorize 注解 - 调整 delete 方法的注解顺序,使其与其它方法保持一致
This commit is contained in:
@@ -32,8 +32,8 @@ public class ConfigController {
|
|||||||
|
|
||||||
private final ConfigService configService;
|
private final ConfigService configService;
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "系统配置分页列表")
|
@Operation(summary = "系统配置分页列表")
|
||||||
|
@GetMapping("/page")
|
||||||
@PreAuthorize("@ss.hasPerm('sys:config:query')")
|
@PreAuthorize("@ss.hasPerm('sys:config:query')")
|
||||||
public PageResult<ConfigVO> page(@ParameterObject ConfigPageQuery configPageQuery) {
|
public PageResult<ConfigVO> page(@ParameterObject ConfigPageQuery configPageQuery) {
|
||||||
IPage<ConfigVO> result = configService.page(configPageQuery);
|
IPage<ConfigVO> result = configService.page(configPageQuery);
|
||||||
@@ -57,21 +57,21 @@ public class ConfigController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "刷新系统配置缓存")
|
@Operation(summary = "刷新系统配置缓存")
|
||||||
@PatchMapping
|
@PutMapping(value = "/refresh")
|
||||||
@PreAuthorize("@ss.hasPerm('sys:config:refresh')")
|
@PreAuthorize("@ss.hasPerm('sys:config:refresh')")
|
||||||
public Result<ConfigForm> refreshCache() {
|
public Result<ConfigForm> refreshCache() {
|
||||||
return Result.judge(configService.refreshCache());
|
return Result.judge(configService.refreshCache());
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping(value = "/{id}")
|
|
||||||
@Operation(summary = "修改系统配置")
|
@Operation(summary = "修改系统配置")
|
||||||
|
@PutMapping(value = "/{id}")
|
||||||
@PreAuthorize("@ss.hasPerm('sys:config:update')")
|
@PreAuthorize("@ss.hasPerm('sys:config:update')")
|
||||||
public Result<?> update(@Valid @PathVariable Long id, @RequestBody ConfigForm configForm) {
|
public Result<?> update(@Valid @PathVariable Long id, @RequestBody ConfigForm configForm) {
|
||||||
return Result.judge(configService.edit(id, configForm));
|
return Result.judge(configService.edit(id, configForm));
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
@Operation(summary = "删除系统配置")
|
@Operation(summary = "删除系统配置")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
@PreAuthorize("@ss.hasPerm('sys:config:delete')")
|
@PreAuthorize("@ss.hasPerm('sys:config:delete')")
|
||||||
public Result<?> delete(@PathVariable Long id) {
|
public Result<?> delete(@PathVariable Long id) {
|
||||||
return Result.judge(configService.delete(id));
|
return Result.judge(configService.delete(id));
|
||||||
|
|||||||
Reference in New Issue
Block a user