提交 a2d6dfe7 编写于 作者: 智布道's avatar 智布道 👁

💡 规范注释

上级 64aa1940
......@@ -7,7 +7,7 @@ import lombok.Setter;
* 授权回调时的参数类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.8.0
*/
@Getter
@Setter
......
......@@ -18,6 +18,8 @@ import me.zhyd.oauth.enums.AuthUserGender;
public class AuthUser {
/**
* 用户第三方系统的唯一id。在调用方集成改组件时,可以用uuid + source唯一确定一个用户
*
* @since 1.3.3
*/
private String uuid;
/**
......
......@@ -21,7 +21,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 支付宝登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.1
*/
public class AuthAlipayRequest extends AuthDefaultRequest {
......
......@@ -15,7 +15,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 百度账号登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.0
*/
public class AuthBaiduRequest extends AuthDefaultRequest {
......
......@@ -15,7 +15,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* Cooding登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.0
*/
public class AuthCodingRequest extends AuthDefaultRequest {
......
......@@ -14,7 +14,7 @@ import me.zhyd.oauth.model.AuthUser;
* CSDN登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.0
*/
@Deprecated
public class AuthCsdnRequest extends AuthDefaultRequest {
......
......@@ -16,7 +16,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @author yangkai.shen (https://xkcoding.com)
* @since 1.8
* @since 1.0.0
*/
@Slf4j
public abstract class AuthDefaultRequest implements AuthRequest {
......
......@@ -18,7 +18,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 钉钉登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.0
*/
public class AuthDingTalkRequest extends AuthDefaultRequest {
......
......@@ -15,7 +15,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 抖音登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.4.0
*/
public class AuthDouyinRequest extends AuthDefaultRequest {
......
......@@ -15,7 +15,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* Facebook登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.3.0
*/
public class AuthFacebookRequest extends AuthDefaultRequest {
......
......@@ -14,7 +14,7 @@ import me.zhyd.oauth.model.AuthUser;
* Gitee登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.0
*/
public class AuthGiteeRequest extends AuthDefaultRequest {
......
......@@ -17,7 +17,7 @@ import java.util.Map;
* Github登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.0
*/
public class AuthGithubRequest extends AuthDefaultRequest {
......
......@@ -16,7 +16,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* Google登录
*
* @author yangkai.shen (https://xkcoding.com)
* @since 1.3
* @since 1.3.0
*/
public class AuthGoogleRequest extends AuthDefaultRequest {
......
......@@ -18,7 +18,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 领英登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.4.0
*/
public class AuthLinkedinRequest extends AuthDefaultRequest {
......
......@@ -18,7 +18,7 @@ import java.text.MessageFormat;
* 小米登录
*
* @author yangkai.shen (https://xkcoding.com)
* @since 1.5
* @since 1.5.0
*/
@Slf4j
public class AuthMiRequest extends AuthDefaultRequest {
......
......@@ -16,7 +16,7 @@ import static me.zhyd.oauth.utils.GlobalAuthUtil.parseQueryToMap;
* 微软登录
*
* @author yangkai.shen (https://xkcoding.com)
* @since 1.5
* @since 1.5.0
*/
public class AuthMicrosoftRequest extends AuthDefaultRequest {
public AuthMicrosoftRequest(AuthConfig config) {
......
......@@ -15,7 +15,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* oschina登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.0
*/
public class AuthOschinaRequest extends AuthDefaultRequest {
......@@ -58,7 +58,7 @@ public class AuthOschinaRequest extends AuthDefaultRequest {
/**
* 返回获取accessToken的url
*
* @param code
* @param code 授权回调时带回的授权码
* @return 返回获取accessToken的url
*/
@Override
......
......@@ -19,7 +19,7 @@ import static me.zhyd.oauth.config.AuthSource.PINTEREST;
* Pinterest登录
*
* @author hongwei.peng (pengisgood(at)gmail(dot)com)
* @since 1.8
* @since 1.9.0
*/
public class AuthPinterestRequest extends AuthDefaultRequest {
......
......@@ -20,7 +20,7 @@ import java.util.Map;
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @author yangkai.shen (https://xkcoding.com)
* @since 1.8
* @since 1.1.0
*/
public class AuthQqRequest extends AuthDefaultRequest {
public AuthQqRequest(AuthConfig config) {
......@@ -68,6 +68,13 @@ public class AuthQqRequest extends AuthDefaultRequest {
.build();
}
/**
* 获取QQ用户的OpenId,支持自定义是否启用查询unionid的功能,如果启用查询unionid的功能,
* 那就需要调用者先通过邮件申请unionid功能,参考链接 {@see http://wiki.connect.qq.com/unionid%E4%BB%8B%E7%BB%8D}
*
* @param authToken 通过{@link AuthQqRequest#getAccessToken(AuthCallback)}获取到的{@code authToken}
* @return openId
*/
private String getOpenId(AuthToken authToken) {
HttpResponse response = HttpRequest.get(UrlBuilder.fromBaseUrl("https://graph.qq.com/oauth2.0/me")
.queryParam("access_token", authToken.getAccessToken())
......
......@@ -19,7 +19,7 @@ import static me.zhyd.oauth.model.AuthResponseStatus.SUCCESS;
* 人人登录
*
* @author hongwei.peng (pengisgood(at)gmail(dot)com)
* @since 1.8
* @since 1.9.0
*/
public class AuthRenrenRequest extends AuthDefaultRequest {
......
......@@ -18,7 +18,7 @@ import static me.zhyd.oauth.utils.GlobalAuthUtil.parseQueryToMap;
* Stack Overflow登录
*
* @author hongwei.peng (pengisgood(at)gmail(dot)com)
* @since 1.8
* @since 1.9.0
*/
public class AuthStackOverflowRequest extends AuthDefaultRequest {
......
......@@ -16,7 +16,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 淘宝登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.1.0
*/
public class AuthTaobaoRequest extends AuthDefaultRequest {
......
......@@ -13,7 +13,7 @@ import me.zhyd.oauth.model.*;
* Teambition授权登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.9.0
*/
public class AuthTeambitionRequest extends AuthDefaultRequest {
......
......@@ -15,7 +15,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 腾讯云登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.0
*/
public class AuthTencentCloudRequest extends AuthDefaultRequest {
......
......@@ -16,7 +16,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 今日头条登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.5
* @since 1.6.0-beta
*/
public class AuthToutiaoRequest extends AuthDefaultRequest {
......
......@@ -14,7 +14,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 微信登录
*
* @author yangkai.shen (https://xkcoding.com)
* @since 1.8
* @since 1.1.0
*/
public class AuthWeChatRequest extends AuthDefaultRequest {
public AuthWeChatRequest(AuthConfig config) {
......
......@@ -19,7 +19,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 微博登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.0
*/
public class AuthWeiboRequest extends AuthDefaultRequest {
......
......@@ -9,7 +9,7 @@ import me.zhyd.oauth.model.AuthResponseStatus;
* 授权配置类的校验器
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.6.1-beta
*/
public class AuthChecker {
......@@ -19,6 +19,7 @@ public class AuthChecker {
* @param config config
* @param source source
* @return true or false
* @since 1.6.1-beta
*/
public static boolean isSupportedAuth(AuthConfig config, AuthSource source) {
boolean isSupported = StringUtils.isNotEmpty(config.getClientId()) && StringUtils.isNotEmpty(config.getClientSecret()) && StringUtils.isNotEmpty(config.getRedirectUri());
......@@ -36,6 +37,7 @@ public class AuthChecker {
*
* @param config config
* @param source source
* @since 1.6.1-beta
*/
public static void checkConfig(AuthConfig config, AuthSource source) {
String redirectUri = config.getRedirectUri();
......@@ -56,6 +58,7 @@ public class AuthChecker {
* 校验回调传回的code
*
* @param code 回调时传回的code
* @since 1.8.0
*/
public static void checkCode(String code) {
if (StringUtils.isEmpty(code)) {
......
......@@ -21,7 +21,7 @@ import java.util.*;
* 全局的工具类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
* @since 1.0.0
*/
public class GlobalAuthUtil {
private static final Charset DEFAULT_ENCODING = StandardCharsets.UTF_8;
......
......@@ -7,7 +7,7 @@ import java.net.UnknownHostException;
* 获取IP的工具类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.0
* @since 1.0.0
*/
public class IpUtils {
......
......@@ -14,7 +14,7 @@ import java.util.Map;
* </p>
*
* @author yangkai.shen (https://xkcoding.com)
* @since 1.8
* @since 1.9.0
*/
@Setter
public class UrlBuilder {
......
......@@ -8,7 +8,6 @@ import org.junit.Test;
/**
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
*/
public class AuthRequestTest {
......
package me.zhyd.oauth.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPath;
import org.junit.Test;
......@@ -12,8 +11,9 @@ import java.util.List;
import java.util.Map;
/**
* 其他测试方法
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
*/
public class CustomTest {
......@@ -68,7 +68,7 @@ public class CustomTest {
}
@Test
public void jsonpath(){
public void jsonpath() {
List<Map<String, Map<String, Object>>> list = new ArrayList<>();
Map<String, Map<String, Object>> map = new HashMap<>();
......
......@@ -45,7 +45,7 @@
2. 将CSDN相关的类置为`Deprecated`,后续可能会删除,也可能一直保留。毕竟CSDN的openAPI已经不对外开放了。
3. `BaseAuthRequest` 改名为 `AuthDefaultRequest`
4. `ResponseStatus` 改名为 `AuthResponseStatus` 并且移动到 `me.zhyd.oauth.model`
5. 合并github上[@xkcoding](https://github.com/xkcoding)[pr#18](https://github.com/zhangyd-c/JustAuth/pull/18),修复小米回调错误问题 同时 支持微信获取
5. 合并github上[@xkcoding](https://github.com/xkcoding)[pr#18](https://github.com/zhangyd-c/JustAuth/pull/18),修复小米回调错误问题 同时 支持微信获取unionId
### 2019/07/15 ([v1.8.1](https://gitee.com/yadong.zhang/JustAuth/releases/v1.8.1))
1. 新增 `AuthState` 类,内置默认的state生成规则和校验规则
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册