| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.dto.RolePowerDto; |
| | | import com.yuanchu.mom.pojo.Role; |
| | | import com.yuanchu.mom.service.PowerService; |
| | | import com.yuanchu.mom.service.RoleService; |
| | | import com.yuanchu.mom.service.UserService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RequestMapping("/role") |
| | |
| | | private RoleService roleService; |
| | | |
| | | private PowerService powerService; |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "获取角色列表枚举") |
| | | @GetMapping("/selectRoleList") |
| | |
| | | return Result.success(roleService.selectList()); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ValueClassify("角色管理") |
| | | @ApiOperation(value = "获取角色列表") |
| | | @PostMapping("/selectRoleLists") |
| | | public Result selectRoleLists(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | RolePowerDto powers = JSON.parseObject(str, RolePowerDto.class); |
| | | return Result.success(roleService.upRole(powers)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "查看当前用户的角色") |
| | | @GetMapping("/getRole") |
| | | public Result<?> getRole() { |
| | | return Result.success(roleService.getRole()); |
| | | } |
| | | } |