use of com.alipay.api.response.AlipayUserInfoShareResponse in project dq-easy-cloud by dq-open-cloud.
the class EcZfbOauthToken method doGetOauthResource.
@Override
public EcBaseOauthResourceDTO doGetOauthResource(Map<String, Object> oAuthResponseParam) throws Exception {
AlipayUserInfoShareRequest userInfoShareRequest = new AlipayUserInfoShareRequest();
String accessToken = EcMapUtils.getString(oAuthResponseParam, EcOauthAccessToken.ACCESS_TOKEN);
AlipayUserInfoShareResponse shareResponse = alipayClient.execute(userInfoShareRequest, accessToken);
EcAssert.verifyObjNull(shareResponse, "shareResponse");
if (shareResponse != null && shareResponse.isSuccess()) {
EcBaseOauthResourceResponse resourceResponse = EcBeanFactory.newInstance(getResourceRequestBuilder().getResourceResponseClass());
EcBaseOauthResourceDTO resourceDTO = EcJSONUtils.parseObject(shareResponse, resourceResponse.getResourceDTOClass());
EcLogUtils.info("授权获取到的用户信息", resourceDTO, logger);
return resourceDTO;
} else {
throw new EcBaseBusinessException(shareResponse.getCode(), shareResponse.getMsg()).buildExceptionDetail(shareResponse);
}
}
Aggregations