1
0
mirror of synced 2026-05-22 13:43:20 +00:00

🍻 规范代码注释

This commit is contained in:
yadong.zhang
2019-08-03 09:49:49 +08:00
parent fabfff60c9
commit ce5c437289
7 changed files with 16 additions and 22 deletions
+1 -3
View File
@@ -4,9 +4,7 @@ package me.zhyd.oauth.cache;
* AuthCache配置类 * AuthCache配置类
* *
* @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0 * @since 1.9.6
* @date 2019/8/1 17:15
* @since 1.8
*/ */
public class AuthCacheConfig { public class AuthCacheConfig {
@@ -1,9 +1,10 @@
package me.zhyd.oauth.cache; package me.zhyd.oauth.cache;
/** /**
* 默认的state缓存实现
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0 * @since 1.9.6
* @since 1.8
*/ */
public enum AuthDefaultStateCache implements AuthStateCache { public enum AuthDefaultStateCache implements AuthStateCache {
+1 -1
View File
@@ -6,7 +6,7 @@ package me.zhyd.oauth.cache;
* </p> * </p>
* *
* @author yangkai.shen * @author yangkai.shen
* @date Created in 2019-08-02 10:55 * @since 1.9.6
*/ */
public interface AuthStateCache { public interface AuthStateCache {
/** /**
+3 -9
View File
@@ -11,15 +11,13 @@ import java.time.format.DateTimeFormatter;
* 针对JustAuth提供的轻量级的日志打印工具 * 针对JustAuth提供的轻量级的日志打印工具
* *
* @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @date 2019/8/1 17:14
* @see Log#debug(String) * @see Log#debug(String)
* @see Log#debug(String, Throwable) * @see Log#debug(String, Throwable)
* @see Log#warn(String) * @see Log#warn(String)
* @see Log#warn(String, Throwable) * @see Log#warn(String, Throwable)
* @see Log#error(String) * @see Log#error(String)
* @see Log#error(String, Throwable) * @see Log#error(String, Throwable)
* @since 1.8 * @since 1.9.6
*/ */
public class Log { public class Log {
@@ -111,9 +109,7 @@ public class Log {
* 日志级别 * 日志级别
* *
* @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0 * @since 1.9.6
* @date 2019/8/2 19:49
* @since 1.8
*/ */
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
@@ -138,9 +134,7 @@ public class Log {
* 日志配置 * 日志配置
* *
* @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0 * @since 1.9.6
* @date 2019/8/1 17:14
* @since 1.8
*/ */
static class Config { static class Config {
@@ -2,7 +2,6 @@ package me.zhyd.oauth.request;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import lombok.extern.slf4j.Slf4j;
import me.zhyd.oauth.cache.AuthDefaultStateCache; import me.zhyd.oauth.cache.AuthDefaultStateCache;
import me.zhyd.oauth.cache.AuthStateCache; import me.zhyd.oauth.cache.AuthStateCache;
import me.zhyd.oauth.config.AuthConfig; import me.zhyd.oauth.config.AuthConfig;
@@ -158,12 +157,12 @@ public abstract class AuthDefaultRequest implements AuthRequest {
protected String refreshTokenUrl(String refreshToken) { protected String refreshTokenUrl(String refreshToken) {
return UrlBuilder.fromBaseUrl(source.refresh()) return UrlBuilder.fromBaseUrl(source.refresh())
.queryParam("client_id", config.getClientId()) .queryParam("client_id", config.getClientId())
.queryParam("client_secret", config.getClientSecret()) .queryParam("client_secret", config.getClientSecret())
.queryParam("refresh_token", refreshToken) .queryParam("refresh_token", refreshToken)
.queryParam("grant_type", "refresh_token") .queryParam("grant_type", "refresh_token")
.queryParam("redirect_uri", config.getRedirectUri()) .queryParam("redirect_uri", config.getRedirectUri())
.build(); .build();
} }
/** /**
* 返回获取userInfo的url * 返回获取userInfo的url
@@ -11,7 +11,10 @@ import me.zhyd.oauth.enums.AuthResponseStatus;
import me.zhyd.oauth.enums.AuthUserGender; import me.zhyd.oauth.enums.AuthUserGender;
import me.zhyd.oauth.exception.AuthException; import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.log.Log; import me.zhyd.oauth.log.Log;
import me.zhyd.oauth.model.*; import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.utils.UrlBuilder; import me.zhyd.oauth.utils.UrlBuilder;
import java.text.MessageFormat; import java.text.MessageFormat;
@@ -1,6 +1,5 @@
package me.zhyd.oauth.utils; package me.zhyd.oauth.utils;
import me.zhyd.oauth.cache.AuthStateCache;
import me.zhyd.oauth.config.AuthConfig; import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.config.AuthSource; import me.zhyd.oauth.config.AuthSource;
import me.zhyd.oauth.enums.AuthResponseStatus; import me.zhyd.oauth.enums.AuthResponseStatus;