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

🎨 解决Issue #IY2HW

上级 82358cbd
...@@ -10,7 +10,7 @@ import java.util.Arrays; ...@@ -10,7 +10,7 @@ import java.util.Arrays;
* @since 1.8 * @since 1.8
*/ */
public enum AuthUserGender { public enum AuthUserGender {
MALE(1, "男"), FEMALE(0, "女"), UNKNOW(-1, ""); MALE(1, "男"), FEMALE(0, "女"), UNKNOW(-1, "未知");
private int code; private int code;
private String desc; private String desc;
......
...@@ -8,6 +8,7 @@ import me.zhyd.oauth.exception.AuthException; ...@@ -8,6 +8,7 @@ import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthSource; import me.zhyd.oauth.model.AuthSource;
import me.zhyd.oauth.model.AuthToken; import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser; import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.model.AuthUserGender;
import me.zhyd.oauth.utils.UrlBuilder; import me.zhyd.oauth.utils.UrlBuilder;
/** /**
...@@ -49,6 +50,7 @@ public class AuthCsdnRequest extends BaseAuthRequest { ...@@ -49,6 +50,7 @@ public class AuthCsdnRequest extends BaseAuthRequest {
.username(object.getString("username")) .username(object.getString("username"))
.remark(object.getString("description")) .remark(object.getString("description"))
.blog(object.getString("website")) .blog(object.getString("website"))
.gender(AuthUserGender.UNKNOW)
.token(authToken) .token(authToken)
.source(AuthSource.CSDN) .source(AuthSource.CSDN)
.build(); .build();
......
...@@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSON; ...@@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import me.zhyd.oauth.config.AuthConfig; import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.exception.AuthException; import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthDingTalkErrorCode; import me.zhyd.oauth.model.*;
import me.zhyd.oauth.model.AuthSource;
import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.utils.GlobalAuthUtil; import me.zhyd.oauth.utils.GlobalAuthUtil;
import me.zhyd.oauth.utils.UrlBuilder; import me.zhyd.oauth.utils.UrlBuilder;
...@@ -58,6 +55,7 @@ public class AuthDingTalkRequest extends BaseAuthRequest { ...@@ -58,6 +55,7 @@ public class AuthDingTalkRequest extends BaseAuthRequest {
.uuid(object.getString("unionid")) .uuid(object.getString("unionid"))
.nickname(object.getString("nick")) .nickname(object.getString("nick"))
.username(object.getString("nick")) .username(object.getString("nick"))
.gender(AuthUserGender.UNKNOW)
.source(AuthSource.DINGTALK) .source(AuthSource.DINGTALK)
.token(token) .token(token)
.build(); .build();
......
...@@ -5,10 +5,7 @@ import cn.hutool.http.HttpResponse; ...@@ -5,10 +5,7 @@ import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import me.zhyd.oauth.config.AuthConfig; import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.exception.AuthException; import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthResponse; import me.zhyd.oauth.model.*;
import me.zhyd.oauth.model.AuthSource;
import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.utils.UrlBuilder; import me.zhyd.oauth.utils.UrlBuilder;
...@@ -45,6 +42,7 @@ public class AuthDouyinRequest extends BaseAuthRequest { ...@@ -45,6 +42,7 @@ public class AuthDouyinRequest extends BaseAuthRequest {
.username(userInfoObject.getString("nickname")) .username(userInfoObject.getString("nickname"))
.nickname(userInfoObject.getString("nickname")) .nickname(userInfoObject.getString("nickname"))
.avatar(userInfoObject.getString("avatar")) .avatar(userInfoObject.getString("avatar"))
.gender(AuthUserGender.UNKNOW)
.token(authToken) .token(authToken)
.source(AuthSource.DOUYIN) .source(AuthSource.DOUYIN)
.build(); .build();
......
...@@ -8,6 +8,7 @@ import me.zhyd.oauth.exception.AuthException; ...@@ -8,6 +8,7 @@ import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthSource; import me.zhyd.oauth.model.AuthSource;
import me.zhyd.oauth.model.AuthToken; import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser; import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.model.AuthUserGender;
import me.zhyd.oauth.utils.UrlBuilder; import me.zhyd.oauth.utils.UrlBuilder;
/** /**
...@@ -52,6 +53,7 @@ public class AuthGiteeRequest extends BaseAuthRequest { ...@@ -52,6 +53,7 @@ public class AuthGiteeRequest extends BaseAuthRequest {
.location(object.getString("address")) .location(object.getString("address"))
.email(object.getString("email")) .email(object.getString("email"))
.remark(object.getString("bio")) .remark(object.getString("bio"))
.gender(AuthUserGender.UNKNOW)
.token(authToken) .token(authToken)
.source(AuthSource.GITEE) .source(AuthSource.GITEE)
.build(); .build();
......
...@@ -8,6 +8,7 @@ import me.zhyd.oauth.exception.AuthException; ...@@ -8,6 +8,7 @@ import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthSource; import me.zhyd.oauth.model.AuthSource;
import me.zhyd.oauth.model.AuthToken; import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser; import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.model.AuthUserGender;
import me.zhyd.oauth.utils.GlobalAuthUtil; import me.zhyd.oauth.utils.GlobalAuthUtil;
import me.zhyd.oauth.utils.UrlBuilder; import me.zhyd.oauth.utils.UrlBuilder;
...@@ -55,6 +56,7 @@ public class AuthGithubRequest extends BaseAuthRequest { ...@@ -55,6 +56,7 @@ public class AuthGithubRequest extends BaseAuthRequest {
.location(object.getString("location")) .location(object.getString("location"))
.email(object.getString("email")) .email(object.getString("email"))
.remark(object.getString("bio")) .remark(object.getString("bio"))
.gender(AuthUserGender.UNKNOW)
.token(authToken) .token(authToken)
.source(AuthSource.GITHUB) .source(AuthSource.GITHUB)
.build(); .build();
......
...@@ -8,6 +8,7 @@ import me.zhyd.oauth.exception.AuthException; ...@@ -8,6 +8,7 @@ import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthSource; import me.zhyd.oauth.model.AuthSource;
import me.zhyd.oauth.model.AuthToken; import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser; import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.model.AuthUserGender;
import me.zhyd.oauth.utils.UrlBuilder; import me.zhyd.oauth.utils.UrlBuilder;
/** /**
...@@ -57,6 +58,7 @@ public class AuthGoogleRequest extends BaseAuthRequest { ...@@ -57,6 +58,7 @@ public class AuthGoogleRequest extends BaseAuthRequest {
.nickname(object.getString("name")) .nickname(object.getString("name"))
.location(object.getString("locale")) .location(object.getString("locale"))
.email(object.getString("email")) .email(object.getString("email"))
.gender(AuthUserGender.UNKNOW)
.token(authToken) .token(authToken)
.source(AuthSource.GOOGLE) .source(AuthSource.GOOGLE)
.build(); .build();
......
...@@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import me.zhyd.oauth.config.AuthConfig; import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.exception.AuthException; import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthResponse; import me.zhyd.oauth.model.*;
import me.zhyd.oauth.model.AuthSource;
import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.utils.StringUtils; import me.zhyd.oauth.utils.StringUtils;
import me.zhyd.oauth.utils.UrlBuilder; import me.zhyd.oauth.utils.UrlBuilder;
...@@ -81,6 +78,7 @@ public class AuthLinkedinRequest extends BaseAuthRequest { ...@@ -81,6 +78,7 @@ public class AuthLinkedinRequest extends BaseAuthRequest {
.avatar(avatar) .avatar(avatar)
.email(email) .email(email)
.token(authToken) .token(authToken)
.gender(AuthUserGender.UNKNOW)
.source(AuthSource.LINKEDIN) .source(AuthSource.LINKEDIN)
.build(); .build();
} }
......
...@@ -6,10 +6,7 @@ import cn.hutool.http.HttpResponse; ...@@ -6,10 +6,7 @@ import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import me.zhyd.oauth.config.AuthConfig; import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.exception.AuthException; import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthResponse; import me.zhyd.oauth.model.*;
import me.zhyd.oauth.model.AuthSource;
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;
...@@ -74,6 +71,7 @@ public class AuthMiRequest extends BaseAuthRequest { ...@@ -74,6 +71,7 @@ public class AuthMiRequest extends BaseAuthRequest {
.nickname(user.getString("miliaoNick")) .nickname(user.getString("miliaoNick"))
.avatar(user.getString("miliaoIcon")) .avatar(user.getString("miliaoIcon"))
.email(user.getString("mail")) .email(user.getString("mail"))
.gender(AuthUserGender.UNKNOW)
.token(authToken) .token(authToken)
.source(AuthSource.MI) .source(AuthSource.MI)
.build(); .build();
......
...@@ -6,10 +6,7 @@ import cn.hutool.http.HttpUtil; ...@@ -6,10 +6,7 @@ import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import me.zhyd.oauth.config.AuthConfig; import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.exception.AuthException; import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthResponse; import me.zhyd.oauth.model.*;
import me.zhyd.oauth.model.AuthSource;
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.util.HashMap; import java.util.HashMap;
...@@ -85,6 +82,7 @@ public class AuthMicrosoftRequest extends BaseAuthRequest { ...@@ -85,6 +82,7 @@ public class AuthMicrosoftRequest extends BaseAuthRequest {
.nickname(object.getString("displayName")) .nickname(object.getString("displayName"))
.location(object.getString("officeLocation")) .location(object.getString("officeLocation"))
.email(object.getString("mail")) .email(object.getString("mail"))
.gender(AuthUserGender.UNKNOW)
.token(authToken) .token(authToken)
.source(AuthSource.MICROSOFT) .source(AuthSource.MICROSOFT)
.build(); .build();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册