Skip to content

Commit

Permalink
🔖 AuthUser添加构造函数,支持反序列化。发布1.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyd-c committed Aug 17, 2019
1 parent fd183af commit 10df9f0
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>
<p align="center">
<a target="_blank" href="https://search.maven.org/search?q=JustAuth">
<img src="https://img.shields.io/badge/Maven Central-1.10.0-blue.svg" ></img>
<img src="https://img.shields.io/badge/Maven Central-1.10.1-blue.svg" ></img>
</a>
<a target="_blank" href="https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE">
<img src="https://img.shields.io/apm/l/vim-mode.svg?color=yellow" ></img>
Expand All @@ -15,7 +15,7 @@
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" ></img>
</a>
<a target="_blank" href="https://apidoc.gitee.com/yadong.zhang/JustAuth/" title="API文档">
<img src="https://img.shields.io/badge/Api Docs-1.10.0-orange.svg" ></img>
<img src="https://img.shields.io/badge/Api Docs-1.10.1-orange.svg" ></img>
</a>
<a target="_blank" href="https://docs.justauth.whnb.wang" title="参考文档">
<img src="https://img.shields.io/badge/Docs-latest-blueviolet.svg" ></img>
Expand Down Expand Up @@ -91,7 +91,7 @@ JustAuth,如你所见,它仅仅是一个**第三方授权登录**的**工具
<dependency>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>1.10.0</version>
<version>1.10.1</version>
</dependency>
```
- 调用api
Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</p>
<p align="center">
<a target="_blank" href="https://search.maven.org/search?q=JustAuth">
<img src="https://img.shields.io/badge/Maven Central-1.10.0-blue.svg" ></img>
<img src="https://img.shields.io/badge/Maven Central-1.10.1-blue.svg" ></img>
</a>
<a target="_blank" href="https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE">
<img src="https://img.shields.io/apm/l/vim-mode.svg?color=yellow" ></img>
Expand All @@ -18,7 +18,7 @@
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" ></img>
</a>
<a target="_blank" href="https://apidoc.gitee.com/yadong.zhang/JustAuth/" title="API文档">
<img src="https://img.shields.io/badge/Api Docs-1.10.0-orange.svg" ></img>
<img src="https://img.shields.io/badge/Api Docs-1.10.1-orange.svg" ></img>
</a>
<a target="_blank" href="https://docs.justauth.whnb.wang" title="参考文档">
<img src="https://img.shields.io/badge/Docs-latest-blueviolet.svg" ></img>
Expand Down Expand Up @@ -93,7 +93,7 @@ JustAuth,如你所见,它仅仅是一个**第三方授权登录**的**工具
<dependency>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>1.10.0</version>
<version>1.10.1</version>
</dependency>
```
- 调用api
Expand Down
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

![](_media/logo.png)
# JustAuth <small>1.10.0</small>
# JustAuth <small>1.10.1</small>

<strong>史上最全的整合第三方登录的开源库</strong>

Expand Down
5 changes: 5 additions & 0 deletions docs/update.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v1.10.1
### 2019/08/17

- AuthUser添加构造函数,支持反序列化

### 2019/08/08

- 项目迁移到组织[justauth](https://github.com/justauth)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>1.10.0</version>
<version>1.10.1</version>

<name>JustAuth</name>
<url>https://gitee.com/yadong.zhang/JustAuth</url>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/me/zhyd/oauth/model/AuthUser.java
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -15,6 +13,8 @@
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AuthUser {
/**
* 用户第三方系统的唯一id。在调用方集成改组件时,可以用uuid + source唯一确定一个用户
Expand Down
31 changes: 31 additions & 0 deletions src/test/java/me/zhyd/oauth/model/AuthUserTest.java
Original file line number Diff line number Diff line change
@@ -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");
}

}

0 comments on commit 10df9f0

Please sign in to comment.