mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
issue #39 公众号添加oauth2的支持
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package me.chanjar.weixin.mp.bean.result;
|
||||
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
/**
|
||||
* Created by qianjia on 14/11/26.
|
||||
@@ -58,7 +59,17 @@ public class WxMpOAuth2AccessToken {
|
||||
}
|
||||
|
||||
public static WxMpOAuth2AccessToken fromJson(String json) {
|
||||
return WxGsonBuilder.create().fromJson(json, WxMpOAuth2AccessToken.class);
|
||||
return WxMpGsonBuilder.create().fromJson(json, WxMpOAuth2AccessToken.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WxMpOAuth2AccessToken{" +
|
||||
"accessToken='" + accessToken + '\'' +
|
||||
", expiresIn=" + expiresIn +
|
||||
", refreshToken='" + refreshToken + '\'' +
|
||||
", openId='" + openId + '\'' +
|
||||
", scope='" + scope + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
*/
|
||||
public class WxMpUser {
|
||||
|
||||
protected boolean subscribe;
|
||||
protected Boolean subscribe;
|
||||
protected String openId;
|
||||
protected String nickname;
|
||||
protected String sex;
|
||||
@@ -18,13 +18,13 @@ public class WxMpUser {
|
||||
protected String province;
|
||||
protected String country;
|
||||
protected String headImgUrl;
|
||||
protected long subscribeTime;
|
||||
protected Long subscribeTime;
|
||||
protected String unionId;
|
||||
|
||||
public boolean isSubscribe() {
|
||||
public Boolean isSubscribe() {
|
||||
return subscribe;
|
||||
}
|
||||
public void setSubscribe(boolean subscribe) {
|
||||
public void setSubscribe(Boolean subscribe) {
|
||||
this.subscribe = subscribe;
|
||||
}
|
||||
public String getOpenId() {
|
||||
@@ -75,10 +75,10 @@ public class WxMpUser {
|
||||
public void setHeadImgUrl(String headImgUrl) {
|
||||
this.headImgUrl = headImgUrl;
|
||||
}
|
||||
public long getSubscribeTime() {
|
||||
public Long getSubscribeTime() {
|
||||
return subscribeTime;
|
||||
}
|
||||
public void setSubscribeTime(long subscribeTime) {
|
||||
public void setSubscribeTime(Long subscribeTime) {
|
||||
this.subscribeTime = subscribeTime;
|
||||
}
|
||||
public String getUnionId() {
|
||||
@@ -91,5 +91,21 @@ public class WxMpUser {
|
||||
public static WxMpUser fromJson(String json) {
|
||||
return WxMpGsonBuilder.INSTANCE.create().fromJson(json, WxMpUser.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WxMpUser{" +
|
||||
"subscribe=" + subscribe +
|
||||
", openId='" + openId + '\'' +
|
||||
", nickname='" + nickname + '\'' +
|
||||
", sex='" + sex + '\'' +
|
||||
", language='" + language + '\'' +
|
||||
", city='" + city + '\'' +
|
||||
", province='" + province + '\'' +
|
||||
", country='" + country + '\'' +
|
||||
", headImgUrl='" + headImgUrl + '\'' +
|
||||
", subscribeTime=" + subscribeTime +
|
||||
", unionId='" + unionId + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user