mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-23 23:58:44 +08:00
#528 WxMpUser类增加三个属性:subscribe_scene、 qr_scene 和qr_scene_str
This commit is contained in:
parent
ae5267dcdf
commit
e1d274811c
@ -1,5 +1,9 @@
|
||||
package me.chanjar.weixin.mp.bean.result;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
@ -7,10 +11,6 @@ import lombok.Data;
|
||||
import me.chanjar.weixin.common.util.ToStringUtils;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 微信用户信息.
|
||||
*
|
||||
@ -56,6 +56,23 @@ public class WxMpUser implements Serializable {
|
||||
*/
|
||||
private String[] privileges;
|
||||
|
||||
/**
|
||||
* subscribe_scene 返回用户关注的渠道来源.
|
||||
* ADD_SCENE_SEARCH 公众号搜索,ADD_SCENE_ACCOUNT_MIGRATION 公众号迁移,ADD_SCENE_PROFILE_CARD 名片分享,ADD_SCENE_QR_CODE 扫描二维码,ADD_SCENEPROFILE LINK 图文页内名称点击,ADD_SCENE_PROFILE_ITEM 图文页右上角菜单,ADD_SCENE_PAID 支付后关注,ADD_SCENE_OTHERS 其他
|
||||
*/
|
||||
private String subscribeScene;
|
||||
|
||||
/**
|
||||
* qr_scene 二维码扫码场景(开发者自定义).
|
||||
*/
|
||||
private String qrScene;
|
||||
|
||||
/**
|
||||
* qr_scene_str 二维码扫码场景描述(开发者自定义).
|
||||
*/
|
||||
private String qrSceneStr;
|
||||
|
||||
|
||||
public static WxMpUser fromJson(String json) {
|
||||
return WxMpGsonBuilder.INSTANCE.create().fromJson(json, WxMpUser.class);
|
||||
}
|
||||
|
@ -33,6 +33,9 @@ public class WxMpUserGsonAdapter implements JsonDeserializer<WxMpUser> {
|
||||
user.setGroupId(GsonHelper.getInteger(o, "groupid"));
|
||||
user.setTagIds(GsonHelper.getLongArray(o, "tagid_list"));
|
||||
user.setPrivileges(GsonHelper.getStringArray(o, "privilege"));
|
||||
user.setSubscribeScene(GsonHelper.getString(o, "subscribe_scene"));
|
||||
user.setQrScene(GsonHelper.getString(o, "qr_scene"));
|
||||
user.setQrSceneStr(GsonHelper.getString(o, "qr_scene_str"));
|
||||
|
||||
Integer sex = GsonHelper.getInteger(o, "sex");
|
||||
if (sex != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user