1
0
mirror of synced 2026-02-23 13:28:07 +08:00

👽 注释、文档

This commit is contained in:
yadong.zhang
2019-05-18 11:26:59 +08:00
parent 6186236a13
commit 79574a66e5
5 changed files with 47 additions and 4 deletions

View File

@@ -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;
/**
* 登录成功后的回调地址
*/

View File

@@ -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();
}

View File

@@ -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;