👽 注释、文档
This commit is contained in:
@@ -6,6 +6,8 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* JustAuth配置类
|
||||
*
|
||||
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
|
||||
* @version 1.0
|
||||
* @since 1.8
|
||||
@@ -15,8 +17,17 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AuthConfig {
|
||||
|
||||
/**
|
||||
* 客户端id:对应个平台的appKey
|
||||
*/
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* 客户端Secret:对应个平台的appSecret
|
||||
*/
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 登录成功后的回调地址
|
||||
*/
|
||||
|
||||
@@ -356,18 +356,33 @@ public enum ApiUrl {
|
||||
|
||||
@Override
|
||||
public String refresh() {
|
||||
return "https://api.weixin.qq.com/sns/oauth2/refresh_token";
|
||||
return "https://api.weixin.qq.com/sns/oauth2/refresh_token";
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 授权的api
|
||||
*/
|
||||
public abstract String authorize();
|
||||
|
||||
/**
|
||||
* 获取accessToken的api
|
||||
*/
|
||||
public abstract String accessToken();
|
||||
|
||||
/**
|
||||
* 获取用户信息的api
|
||||
*/
|
||||
public abstract String userInfo();
|
||||
|
||||
/**
|
||||
* 取消授权的api
|
||||
*/
|
||||
public abstract String revoke();
|
||||
|
||||
/**
|
||||
* 刷新授权的api
|
||||
*/
|
||||
public abstract String refresh();
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package me.zhyd.oauth.model;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
|
||||
* @version 1.0
|
||||
@@ -19,10 +21,12 @@ public enum AuthUserGender {
|
||||
if (code == null) {
|
||||
return UNKNOW;
|
||||
}
|
||||
if ("m".equals(code) || "男".equals(code) || "1".equals(code) || "male".equalsIgnoreCase(code) || "F".equalsIgnoreCase(code)) {
|
||||
String[] males = {"m", "男", "1", "male", "F"};
|
||||
if (Arrays.asList(males).contains(code)) {
|
||||
return MALE;
|
||||
}
|
||||
if ("f".equals(code) || "女".equals(code) || "0".equals(code) || "female".equalsIgnoreCase(code)) {
|
||||
String[] females = {"f", "女", "0", "female"};
|
||||
if (Arrays.asList(females).contains(code)) {
|
||||
return FEMALE;
|
||||
}
|
||||
return UNKNOW;
|
||||
|
||||
Reference in New Issue
Block a user