use of info.xiancloud.core.apidoc.annotation.DocOAuth20Sub in project xian by happyyangyuan.
the class OAuth20Handler method handleDeleteScope.
@DocOAuth20Sub(name = "handleDeleteScope", dec = "删除单个scope", method = "DELETE", url = "/oauth2.0/scopes/{scopeName}", args = { @DocOAuth20SubIn(name = "scope", dec = "scope name", require = true, type = String.class) })
FullHttpResponse handleDeleteScope(FullHttpRequest req) {
FullHttpResponse response;
Matcher m = OAUTH_CLIENT_SCOPE_PATTERN.matcher(req.uri());
if (m.find()) {
String scopeName = m.group(1);
ScopeService scopeService = getScopeService();
try {
String responseMsg = scopeService.deleteScope(scopeName);
response = ResponseBuilder.createOkResponse(responseMsg);
} catch (OAuthException e) {
invokeExceptionHandler(e, req);
response = ResponseBuilder.createResponse(e.getHttpStatus(), e.getMessage());
}
} else {
response = ResponseBuilder.createNotFoundResponse();
}
return response;
}
Aggregations