class RolesController {

    @Autowired
    private RolesServices rolesServices;

    @WebAspect
    @Operation(summary = "查询所有角色信息", description = "查询所有角色信息")
    @GetMapping("/list")
    @Parameters(value = {
            @Parameter(name = "page", description = "页码"),
            @Parameter(name = "pageSize", description = "每页请求数量"),
            @Parameter(name = "isAll", description = "是否全部"),
            @Parameter(name = "roleName", description = "角色名称"),

    })
    public RespModel<CommentPage<RolesDTO>> listResources(@RequestParam(name = "page") int page,
                                                          @RequestParam(name = "pageSize", required = false, defaultValue = "20") int pageSize,
                                                          @RequestParam(name = "isAll", required = false) boolean isAll,
                                                          @RequestParam(name = "roleName", required = false) String roleName) {
        Page<Roles> pageable = new Page<>(page, pageSize);
        if (isAll) {
            pageable.setSize(1000L);
        }

        return RespModel.result(RespEnum.SEARCH_OK, rolesServices.listRoles(pageable, roleName));
    }


    @WebAspect
    @Operation(summary = "编辑或新增角色", description = "编辑或新增角色")
    @PutMapping("/edit")
    public RespModel<String> editResources(@RequestBody RolesDTO rolesDTO) {
        rolesServices.save(rolesDTO);
        return RespModel.result(RespEnum.UPDATE_OK);
    }

    @WebAspect
    @Operation(summary = "删除角色", description = "返回当前第一页角色")
    @Parameter(name = "id", description = "角色id")
    @DeleteMapping("/delete")
    public RespModel<CommentPage<RolesDTO>> deleteCheck(@RequestParam(name = "id") int id) {<FILL_FUNCTION_BODY>}

    @WebAspect
    @Operation(summary = "编辑角色资源鉴权状态", description = "编辑是否成功")
    @Parameters(value = {
            @Parameter(name = "roleId", description = "角色 id"),
            @Parameter(name = "resId", description = "资源 id"),
            @Parameter(name = "hasAuth", description = "是否有权限")
    })
    @PutMapping("/update")
    public RespModel<String> editResourceRoles(@RequestParam(name = "roleId") int roleId,
                                               @RequestParam(name = "resId") int resId,
                                               @RequestParam(name = "hasAuth") boolean hasAuth) {

        rolesServices.editResourceRoles(roleId, resId, hasAuth);

        return RespModel.result(RespEnum.UPDATE_OK);
    }


}


        rolesServices.delete(id);

        Page<Roles> pageable = new Page<>(1, 20);
        return RespModel.result(RespEnum.SEARCH_OK, rolesServices.listRoles(pageable, null));
    
<no_super_class>