diff --git a/README.md b/README.md index 042437e1..5cd83fd7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

- + @@ -15,7 +15,7 @@ - + @@ -91,7 +91,7 @@ JustAuth,如你所见,它仅仅是一个**第三方授权登录**的**工具 me.zhyd.oauth JustAuth - 1.10.0 + 1.10.1 ``` - 调用api diff --git a/docs/README.md b/docs/README.md index cdc9ff97..e91eba17 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,7 +9,7 @@

- + @@ -18,7 +18,7 @@ - + @@ -93,7 +93,7 @@ JustAuth,如你所见,它仅仅是一个**第三方授权登录**的**工具 me.zhyd.oauth JustAuth - 1.10.0 + 1.10.1 ``` - 调用api diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 771d0dfc..03062e37 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@ ![](_media/logo.png) -# JustAuth 1.10.0 +# JustAuth 1.10.1 史上最全的整合第三方登录的开源库 diff --git a/docs/update.md b/docs/update.md index 5a79fee7..3d3c690c 100644 --- a/docs/update.md +++ b/docs/update.md @@ -1,3 +1,8 @@ +## v1.10.1 +### 2019/08/17 + +- AuthUser添加构造函数,支持反序列化 + ### 2019/08/08 - 项目迁移到组织[justauth](https://github.com/justauth) diff --git a/pom.xml b/pom.xml index 48fe6795..e1ead62a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.zhyd.oauth JustAuth - 1.10.0 + 1.10.1 JustAuth https://gitee.com/yadong.zhang/JustAuth diff --git a/src/main/java/me/zhyd/oauth/model/AuthUser.java b/src/main/java/me/zhyd/oauth/model/AuthUser.java index d98e7272..59080758 100644 --- a/src/main/java/me/zhyd/oauth/model/AuthUser.java +++ b/src/main/java/me/zhyd/oauth/model/AuthUser.java @@ -1,8 +1,6 @@ package me.zhyd.oauth.model; -import lombok.Builder; -import lombok.Getter; -import lombok.Setter; +import lombok.*; import me.zhyd.oauth.config.AuthSource; import me.zhyd.oauth.enums.AuthUserGender; @@ -15,6 +13,8 @@ @Getter @Setter @Builder +@NoArgsConstructor +@AllArgsConstructor public class AuthUser { /** * 用户第三方系统的唯一id。在调用方集成改组件时,可以用uuid + source唯一确定一个用户 diff --git a/src/test/java/me/zhyd/oauth/model/AuthUserTest.java b/src/test/java/me/zhyd/oauth/model/AuthUserTest.java new file mode 100644 index 00000000..1b6eaf48 --- /dev/null +++ b/src/test/java/me/zhyd/oauth/model/AuthUserTest.java @@ -0,0 +1,31 @@ +package me.zhyd.oauth.model; + +import com.alibaba.fastjson.JSON; +import org.junit.Assert; +import org.junit.Test; + +public class AuthUserTest { + + @Test + public void serialize() { + + AuthUser user = AuthUser.builder() + .nickname("test") + .build(); + String json = JSON.toJSONString(user); + Assert.assertEquals(json, "{\"nickname\":\"test\"}"); + + } + + @Test + public void deserialize() { + AuthUser user = AuthUser.builder() + .nickname("test") + .build(); + String json = JSON.toJSONString(user); + + AuthUser deserializeUser = JSON.parseObject(json, AuthUser.class); + Assert.assertEquals(deserializeUser.getNickname(), "test"); + } + +}