Initial commit
This commit is contained in:
@@ -2,7 +2,7 @@ package com.atguigu.auth.controller;
|
||||
|
||||
import com.atguigu.auth.service.SysMenuService;
|
||||
import com.atguigu.auth.service.SysUserService;
|
||||
import com.atguigu.common.execption.GuiguException;
|
||||
import com.atguigu.common.config.execption.GuiguException;
|
||||
import com.atguigu.common.jwt.JwtHelper;
|
||||
import com.atguigu.common.result.Result;
|
||||
import com.atguigu.common.utils.MD5;
|
||||
|
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -63,11 +64,11 @@ public class SysRoleController {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询所有角色")
|
||||
@GetMapping("findAll")
|
||||
public Result findAll() {
|
||||
return Result.ok(sysRoleService.list());
|
||||
}
|
||||
// @ApiOperation("查询所有角色")
|
||||
// @GetMapping("findAll")
|
||||
// public Result findAll() {
|
||||
// return Result.ok(sysRoleService.list());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 条件分页查询
|
||||
@@ -76,6 +77,7 @@ public class SysRoleController {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('bnt.sysRole.list')")
|
||||
@ApiOperation("条件分页查询")
|
||||
@GetMapping("{page}/{limit}")
|
||||
public Result pageQueryRole(@PathVariable Long page,
|
||||
@@ -105,6 +107,7 @@ public class SysRoleController {
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('bnt.sysRole.add')")
|
||||
@ApiOperation("添加角色")
|
||||
@PostMapping("save")
|
||||
public Result save(@RequestBody SysRole role) {
|
||||
@@ -123,6 +126,7 @@ public class SysRoleController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('bnt.sysRole.list')")
|
||||
@ApiOperation("根据id查询")
|
||||
@GetMapping("get/{id}")
|
||||
public Result get(@PathVariable Long id) {
|
||||
@@ -136,6 +140,7 @@ public class SysRoleController {
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('bnt.sysRole.update')")
|
||||
@ApiOperation("修改角色")
|
||||
@PutMapping("update")
|
||||
public Result update(@RequestBody SysRole role) {
|
||||
@@ -154,6 +159,7 @@ public class SysRoleController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('bnt.sysRole.remove')")
|
||||
@ApiOperation("根据id删除")
|
||||
@DeleteMapping("remove/{id}")
|
||||
public Result remove(@PathVariable Long id) {
|
||||
@@ -172,6 +178,7 @@ public class SysRoleController {
|
||||
* @param idList
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('bnt.sysRole.remove')")
|
||||
@ApiOperation("批量删除")
|
||||
@DeleteMapping("batchRemove")
|
||||
public Result batchRemove(@RequestBody List<Long> idList) {
|
||||
|
Reference in New Issue
Block a user