mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-04 22:41:24 +08:00
Refactored ResponseResult, added api documentation for PowerController, RoleController, GroupController and UserController
This commit is contained in:
@@ -3,7 +3,10 @@ package com.cfive.pinnacle.controller.permission;
|
||||
import com.cfive.pinnacle.entity.common.ResponseResult;
|
||||
import com.cfive.pinnacle.entity.permission.PowerSet;
|
||||
import com.cfive.pinnacle.service.permission.IPowerService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -16,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author FatttSnake
|
||||
* @since 2023-04-30
|
||||
*/
|
||||
@Tag(name = "权限", description = "权限相关接口")
|
||||
@RestController
|
||||
@RequestMapping("/power")
|
||||
public class PowerController {
|
||||
@@ -26,8 +30,10 @@ public class PowerController {
|
||||
this.powerService = powerService;
|
||||
}
|
||||
|
||||
@Operation(summary = "获取所有权限")
|
||||
@GetMapping
|
||||
public ResponseResult getAllPower() {
|
||||
@PreAuthorize("hasAnyAuthority('system:role:add', 'system:role:modify')")
|
||||
public ResponseResult<PowerSet> getAllPower() {
|
||||
PowerSet powerSet = powerService.getAllPower();
|
||||
|
||||
return ResponseResult.databaseSelectSuccess(powerSet);
|
||||
|
||||
Reference in New Issue
Block a user