2024-04-22 18:39:37 +08:00
|
|
|
package com.atguigu.auth.controller;
|
|
|
|
|
|
|
|
import com.atguigu.auth.service.SysRoleService;
|
|
|
|
import com.atguigu.common.result.Result;
|
|
|
|
import com.atguigu.model.system.SysRole;
|
2024-04-22 18:48:19 +08:00
|
|
|
import com.atguigu.vo.system.SysRoleQueryVo;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
2024-04-22 18:39:37 +08:00
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
2024-04-22 18:48:19 +08:00
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
2024-04-22 18:39:37 +08:00
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
@Api(tags = "角色管理")
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/admin/system/sysRole")
|
|
|
|
public class SysRoleController {
|
|
|
|
@Autowired
|
|
|
|
private SysRoleService sysRoleService;
|
|
|
|
|
|
|
|
@ApiOperation(value = "查询全部角色列表")
|
|
|
|
@GetMapping("findAll")
|
|
|
|
public Result<List<SysRole>> findAll() {
|
|
|
|
List<SysRole> sysRoleList = sysRoleService.list();
|
|
|
|
return Result.success(sysRoleList);
|
|
|
|
}
|
2024-04-22 18:48:19 +08:00
|
|
|
|
|
|
|
@ApiOperation("角色条件分页查询")
|
|
|
|
@GetMapping("{page}/{limit}")
|
|
|
|
public Result<IPage<SysRole>> pageResult(@PathVariable Long page, @PathVariable Long limit, SysRoleQueryVo sysRoleQueryVo) {
|
|
|
|
IPage<SysRole> sysRoleIPage = sysRoleService.pageResult(page, limit, sysRoleQueryVo);
|
|
|
|
return Result.success(sysRoleIPage);
|
|
|
|
}
|
2024-04-22 18:39:37 +08:00
|
|
|
}
|