package com.example.erp.controller.userInfo; import cn.dev33.satoken.annotation.SaCheckPermission; import com.example.erp.common.Result; import com.example.erp.entity.userInfo.Role; import com.example.erp.service.userInfo.RoleService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @RestController @Api(value="角色controller",tags={"角色操作接口"}) @RequestMapping("/role") public class RoleController { private final RoleService roleService; public RoleController(RoleService roleService) { this.roleService = roleService; } @ApiOperation("查询所有角色") @SaCheckPermission("roleList.search") @GetMapping("/findAll") public Result findAll(){ return Result.seccess(roleService.findAll()); } @ApiOperation("新增角色") @SaCheckPermission("roleList.add") @PostMapping("/add") public Result add(@RequestBody Role role){ return Result.seccess(roleService.add(role)); } }