package com.atguigu.auth.controller; import com.atguigu.auth.service.SysRoleService; import com.atguigu.common.result.Result; import com.atguigu.model.system.SysRole; import com.atguigu.vo.system.SysRoleQueryVo; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; 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> findAll() { List sysRoleList = sysRoleService.list(); return Result.success(sysRoleList); } @ApiOperation("角色条件分页查询") @GetMapping("{page}/{limit}") public Result> pageResult(@PathVariable Long page, @PathVariable Long limit, SysRoleQueryVo sysRoleQueryVo) { IPage sysRoleIPage = sysRoleService.pageResult(page, limit, sysRoleQueryVo); return Result.success(sysRoleIPage); } }