diff --git a/src/main/java/me/zhyd/oauth/model/AuthBaiduErrorCode.java b/src/main/java/me/zhyd/oauth/model/AuthBaiduErrorCode.java index 83bc5b9a8c275cabcef09d2ad5de7033fac87756..ee22c2697378e851753ace471669d42ee2e9bd2f 100644 --- a/src/main/java/me/zhyd/oauth/model/AuthBaiduErrorCode.java +++ b/src/main/java/me/zhyd/oauth/model/AuthBaiduErrorCode.java @@ -3,6 +3,8 @@ package me.zhyd.oauth.model; import me.zhyd.oauth.utils.StringUtils; /** + * 百度授权登录时的异常状态码 + * * @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @version 1.0 * @since 1.8 diff --git a/src/main/java/me/zhyd/oauth/model/AuthDingTalkErrorCode.java b/src/main/java/me/zhyd/oauth/model/AuthDingTalkErrorCode.java index 4a5befcfa3c833369c1cdbb71eb599a060232f3e..ce8f9da193522d0ae3986f4474979d2543fc7c80 100644 --- a/src/main/java/me/zhyd/oauth/model/AuthDingTalkErrorCode.java +++ b/src/main/java/me/zhyd/oauth/model/AuthDingTalkErrorCode.java @@ -1,14 +1,13 @@ package me.zhyd.oauth.model; /** + * 钉钉授权登录时的异常状态码 + * * @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @version 1.0 * @since 1.8 */ public enum AuthDingTalkErrorCode { - /** - * 异常状态码 - */ EC1_MINUS(-1, "系统繁忙", "服务器暂不可用,建议稍候再重试1次,最多重试3次"), EC0(0, "请求成功", "接口调用成功"), EC404(404, "请求的URI地址不存在", "地址不存在,检查下url是否和文档里写的一致"), diff --git a/src/main/java/me/zhyd/oauth/model/AuthResponse.java b/src/main/java/me/zhyd/oauth/model/AuthResponse.java index 97539ea86fbac469d6545c2abee16c41e7947fc1..c8f1f0e3b5ec9799afd5fa09b05ba72d84d2acf9 100644 --- a/src/main/java/me/zhyd/oauth/model/AuthResponse.java +++ b/src/main/java/me/zhyd/oauth/model/AuthResponse.java @@ -5,6 +5,8 @@ import lombok.Data; import me.zhyd.oauth.request.ResponseStatus; /** + * JustAuth统一授权响应类 + * * @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @version 1.0 * @since 1.8 @@ -12,7 +14,18 @@ import me.zhyd.oauth.request.ResponseStatus; @Builder @Data public class AuthResponse { + /** + * 授权响应状态码,默认为2000 + */ private int code = ResponseStatus.SUCCESS.getCode(); + + /** + * 授权响应信息,默认为Success + */ private String msg = ResponseStatus.SUCCESS.getMsg(); + + /** + * 授权响应数据,当且仅当 code = 2000 时返回 + */ private T data; } diff --git a/src/main/java/me/zhyd/oauth/model/AuthSource.java b/src/main/java/me/zhyd/oauth/model/AuthSource.java index 04cb751043cfa9cffdb3dd6796dc295d5e48a0e4..f53704aa1bff9b8c5fb2a0fd0a3cb723da6c4c44 100644 --- a/src/main/java/me/zhyd/oauth/model/AuthSource.java +++ b/src/main/java/me/zhyd/oauth/model/AuthSource.java @@ -21,9 +21,6 @@ public enum AuthSource { TAOBAO, QQ, WECHAT, - /** - * 谷歌登录,参考文档:https://developers.google.com/identity/protocols/OpenIDConnect - */ GOOGLE, FACEBOOK, } diff --git a/src/main/java/me/zhyd/oauth/model/AuthToken.java b/src/main/java/me/zhyd/oauth/model/AuthToken.java index ebadf0c61c9b57c8fadfcc701b15d124db81cc13..56ecb203ea833bdaa0b27ea2fdf5cd2a51e5ed2f 100644 --- a/src/main/java/me/zhyd/oauth/model/AuthToken.java +++ b/src/main/java/me/zhyd/oauth/model/AuthToken.java @@ -4,6 +4,8 @@ import lombok.Builder; import lombok.Data; /** + * 授权所需的token + * * @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @version 1.0 * @since 1.8 diff --git a/src/main/java/me/zhyd/oauth/model/AuthUser.java b/src/main/java/me/zhyd/oauth/model/AuthUser.java index 82d15c5db7b07563790e6f25248cf9204a2d735f..43d3714e488e4aa95642a80013747b97d264f7e9 100644 --- a/src/main/java/me/zhyd/oauth/model/AuthUser.java +++ b/src/main/java/me/zhyd/oauth/model/AuthUser.java @@ -4,6 +4,8 @@ import lombok.Builder; import lombok.Data; /** + * 授权成功后的用户信息,根据授权平台的不同,获取的数据完整性也不同 + * * @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @version 1.0 * @since 1.8 diff --git a/src/main/java/me/zhyd/oauth/model/AuthUserGender.java b/src/main/java/me/zhyd/oauth/model/AuthUserGender.java index be3a98898589a42a860c3c8f9f32416780168025..b5dbd05ad64a9a412e88af6a8681e147f6bf66ca 100644 --- a/src/main/java/me/zhyd/oauth/model/AuthUserGender.java +++ b/src/main/java/me/zhyd/oauth/model/AuthUserGender.java @@ -3,6 +3,8 @@ package me.zhyd.oauth.model; import java.util.Arrays; /** + * 用户性别 + * * @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @version 1.0 * @since 1.8 diff --git a/src/main/java/me/zhyd/oauth/utils/AuthConfigChecker.java b/src/main/java/me/zhyd/oauth/utils/AuthConfigChecker.java index 8ef644ca6b87c34291befb30ca3002fb54e890a5..ca58d14cacd45db7ad85495e67e9e63854c46cbc 100644 --- a/src/main/java/me/zhyd/oauth/utils/AuthConfigChecker.java +++ b/src/main/java/me/zhyd/oauth/utils/AuthConfigChecker.java @@ -3,6 +3,8 @@ package me.zhyd.oauth.utils; import me.zhyd.oauth.config.AuthConfig; /** + * 授权配置类的校验器 + * * @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @version 1.0 * @since 1.8 diff --git a/src/main/java/me/zhyd/oauth/utils/GlobalAuthUtil.java b/src/main/java/me/zhyd/oauth/utils/GlobalAuthUtil.java index dc12a657e2a63daba8bf44fcd38f1c47b00ac1fb..5bf022e764d716868bdfbaeec38bf2ef0185ea8b 100644 --- a/src/main/java/me/zhyd/oauth/utils/GlobalAuthUtil.java +++ b/src/main/java/me/zhyd/oauth/utils/GlobalAuthUtil.java @@ -14,6 +14,13 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +/** + * 全局的工具类 + * + * @author yadong.zhang (yadong.zhang0415(a)gmail.com) + * @version 1.0 + * @since 1.8 + */ public class GlobalAuthUtil { private static final String DEFAULT_ENCODING = "UTF-8"; private static final String ALGORITHM = "HmacSHA256";