Optimize RoleController

This commit is contained in:
2023-11-15 18:06:51 +08:00
parent 3735ded9f2
commit c921c56e46
6 changed files with 20 additions and 12 deletions

View File

@@ -24,7 +24,7 @@ import top.fatweb.api.vo.permission.RoleWithPowerVo
class RoleController(
private val roleService: IRoleService
) {
@Operation(summary = "获取角色列表")
@Operation(summary = "获取角色")
@GetMapping
fun get(roleGetParam: RoleGetParam?): ResponseResult<PageVo<RoleWithPowerVo>> {
return ResponseResult.databaseSuccess(
@@ -40,6 +40,14 @@ class RoleController(
)
}
@Operation(summary = "获取角色列表")
@GetMapping("/list")
fun list(): ResponseResult<List<RoleVo>> {
return ResponseResult.databaseSuccess(
data = roleService.listAll()
)
}
@Operation(summary = "添加角色")
@PostMapping
fun add(@Valid @RequestBody roleAddParam: RoleAddParam): ResponseResult<RoleVo> {