mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-23 22:11:40 +08:00
修改代码格式使用两个空格
This commit is contained in:
parent
5525c4fa27
commit
4047f6dbd6
@ -14,55 +14,55 @@ import me.chanjar.weixin.mp.bean.result.WxMpUserList;
|
|||||||
*/
|
*/
|
||||||
public interface WxMpUserService {
|
public interface WxMpUserService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 设置用户备注名接口
|
* 设置用户备注名接口
|
||||||
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=设置用户备注名接口
|
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=设置用户备注名接口
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param openid 用户openid
|
* @param openid 用户openid
|
||||||
* @param remark 备注名
|
* @param remark 备注名
|
||||||
*/
|
*/
|
||||||
void userUpdateRemark(String openid, String remark) throws WxErrorException;
|
void userUpdateRemark(String openid, String remark) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 获取用户基本信息
|
* 获取用户基本信息
|
||||||
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取用户基本信息
|
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取用户基本信息
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param openid 用户openid
|
* @param openid 用户openid
|
||||||
* @param lang 语言,zh_CN 简体(默认),zh_TW 繁体,en 英语
|
* @param lang 语言,zh_CN 简体(默认),zh_TW 繁体,en 英语
|
||||||
*/
|
*/
|
||||||
WxMpUser userInfo(String openid, String lang) throws WxErrorException;
|
WxMpUser userInfo(String openid, String lang) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 获取用户基本信息列表
|
* 获取用户基本信息列表
|
||||||
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=批量获取用户基本信息
|
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=批量获取用户基本信息
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param openid 用户openid, lang 使用默认(zh_CN 简体)
|
* @param openid 用户openid, lang 使用默认(zh_CN 简体)
|
||||||
*/
|
*/
|
||||||
List<WxMpUser> userInfoList(List<String> openidList) throws WxErrorException;
|
List<WxMpUser> userInfoList(List<String> openidList) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 获取用户基本信息列表
|
* 获取用户基本信息列表
|
||||||
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=批量获取用户基本信息
|
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=批量获取用户基本信息
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param userQuery 详细查询参数
|
* @param userQuery 详细查询参数
|
||||||
*/
|
*/
|
||||||
List<WxMpUser> userInfoList(WxMpUserQuery userQuery) throws WxErrorException;
|
List<WxMpUser> userInfoList(WxMpUserQuery userQuery) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 获取关注者列表
|
* 获取关注者列表
|
||||||
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取关注者列表
|
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取关注者列表
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param nextOpenid 可选,第一个拉取的OPENID,null为从头开始拉取
|
* @param nextOpenid 可选,第一个拉取的OPENID,null为从头开始拉取
|
||||||
*/
|
*/
|
||||||
WxMpUserList userList(String nextOpenid) throws WxErrorException;
|
WxMpUserList userList(String nextOpenid) throws WxErrorException;
|
||||||
}
|
}
|
||||||
|
@ -17,47 +17,47 @@ import me.chanjar.weixin.mp.bean.result.WxMpUserList;
|
|||||||
* Created by Binary Wang on 2016/7/21.
|
* Created by Binary Wang on 2016/7/21.
|
||||||
*/
|
*/
|
||||||
public class WxMpUserServiceImpl implements WxMpUserService {
|
public class WxMpUserServiceImpl implements WxMpUserService {
|
||||||
private static final String API_URL_PREFIX = "https://api.weixin.qq.com/cgi-bin/user";
|
private static final String API_URL_PREFIX = "https://api.weixin.qq.com/cgi-bin/user";
|
||||||
private WxMpService wxMpService;
|
private WxMpService wxMpService;
|
||||||
|
|
||||||
public WxMpUserServiceImpl(WxMpService wxMpService) {
|
public WxMpUserServiceImpl(WxMpService wxMpService) {
|
||||||
this.wxMpService = wxMpService;
|
this.wxMpService = wxMpService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void userUpdateRemark(String openid, String remark) throws WxErrorException {
|
public void userUpdateRemark(String openid, String remark) throws WxErrorException {
|
||||||
String url = API_URL_PREFIX + "/info/updateremark";
|
String url = API_URL_PREFIX + "/info/updateremark";
|
||||||
JsonObject json = new JsonObject();
|
JsonObject json = new JsonObject();
|
||||||
json.addProperty("openid", openid);
|
json.addProperty("openid", openid);
|
||||||
json.addProperty("remark", remark);
|
json.addProperty("remark", remark);
|
||||||
this.wxMpService.execute(new SimplePostRequestExecutor(), url, json.toString());
|
this.wxMpService.execute(new SimplePostRequestExecutor(), url, json.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxMpUser userInfo(String openid, String lang) throws WxErrorException {
|
public WxMpUser userInfo(String openid, String lang) throws WxErrorException {
|
||||||
String url = API_URL_PREFIX + "/info";
|
String url = API_URL_PREFIX + "/info";
|
||||||
lang = lang == null ? "zh_CN" : lang;
|
lang = lang == null ? "zh_CN" : lang;
|
||||||
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, "openid=" + openid + "&lang=" + lang);
|
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, "openid=" + openid + "&lang=" + lang);
|
||||||
return WxMpUser.fromJson(responseContent);
|
return WxMpUser.fromJson(responseContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxMpUserList userList(String next_openid) throws WxErrorException {
|
public WxMpUserList userList(String next_openid) throws WxErrorException {
|
||||||
String url = API_URL_PREFIX + "/get";
|
String url = API_URL_PREFIX + "/get";
|
||||||
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, next_openid == null ? null : "next_openid=" + next_openid);
|
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, next_openid == null ? null : "next_openid=" + next_openid);
|
||||||
return WxMpUserList.fromJson(responseContent);
|
return WxMpUserList.fromJson(responseContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WxMpUser> userInfoList(List<String> openidList) throws WxErrorException {
|
public List<WxMpUser> userInfoList(List<String> openidList) throws WxErrorException {
|
||||||
return userInfoList(new WxMpUserQuery(openidList));
|
return userInfoList(new WxMpUserQuery(openidList));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WxMpUser> userInfoList(WxMpUserQuery userQuery) throws WxErrorException {
|
public List<WxMpUser> userInfoList(WxMpUserQuery userQuery) throws WxErrorException {
|
||||||
String url = API_URL_PREFIX + "/info/batchget";
|
String url = API_URL_PREFIX + "/info/batchget";
|
||||||
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, userQuery.toJsonString());
|
String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, userQuery.toJsonString());
|
||||||
return WxMpUser.fromJsonList(responseContent);
|
return WxMpUser.fromJsonList(responseContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,180 +15,180 @@ import com.google.gson.Gson;
|
|||||||
* @author LiuJunGuang
|
* @author LiuJunGuang
|
||||||
*/
|
*/
|
||||||
public class WxMpUserQuery {
|
public class WxMpUserQuery {
|
||||||
private List<WxMpUserQueryParam> queryParamList = new ArrayList<>();
|
private List<WxMpUserQueryParam> queryParamList = new ArrayList<>();
|
||||||
|
|
||||||
public WxMpUserQuery() {
|
public WxMpUserQuery() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 语言使用默认(zh_CN)
|
* 语言使用默认(zh_CN)
|
||||||
*
|
*
|
||||||
* @description
|
* @description
|
||||||
* @param openIdList
|
* @param openIdList
|
||||||
*/
|
*/
|
||||||
public WxMpUserQuery(List<String> openIdList) {
|
public WxMpUserQuery(List<String> openIdList) {
|
||||||
super();
|
super();
|
||||||
add(openIdList);
|
add(openIdList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加OpenId列表,语言使用默认(zh_CN)
|
* 添加OpenId列表,语言使用默认(zh_CN)
|
||||||
*
|
*
|
||||||
* @param openIdList
|
* @param openIdList
|
||||||
* @return {@link WxMpUserQuery}
|
* @return {@link WxMpUserQuery}
|
||||||
*/
|
*/
|
||||||
public WxMpUserQuery add(List<String> openIdList) {
|
public WxMpUserQuery add(List<String> openIdList) {
|
||||||
for (String openId : openIdList) {
|
for (String openId : openIdList) {
|
||||||
this.add(openId);
|
this.add(openId);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加一个OpenId
|
* 添加一个OpenId
|
||||||
*
|
*
|
||||||
* @param openId
|
* @param openId
|
||||||
* @param lang 国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
|
* @param lang 国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
|
||||||
* @return {@link WxMpUserQuery}
|
* @return {@link WxMpUserQuery}
|
||||||
*/
|
*/
|
||||||
public WxMpUserQuery add(String openId, String lang) {
|
public WxMpUserQuery add(String openId, String lang) {
|
||||||
queryParamList.add(new WxMpUserQueryParam(openId, lang));
|
queryParamList.add(new WxMpUserQueryParam(openId, lang));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加一个OpenId到列表中,并返回本对象
|
* 添加一个OpenId到列表中,并返回本对象
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* 该方法默认lang = zh_CN
|
* 该方法默认lang = zh_CN
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param openId
|
* @param openId
|
||||||
* @return {@link WxMpUserQuery}
|
* @return {@link WxMpUserQuery}
|
||||||
*/
|
*/
|
||||||
public WxMpUserQuery add(String openId) {
|
public WxMpUserQuery add(String openId) {
|
||||||
queryParamList.add(new WxMpUserQueryParam(openId));
|
queryParamList.add(new WxMpUserQueryParam(openId));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除指定的OpenId,语言使用默认(zh_CN)
|
* 删除指定的OpenId,语言使用默认(zh_CN)
|
||||||
*
|
*
|
||||||
* @param openId
|
* @param openId
|
||||||
* @return {@link WxMpUserQuery}
|
* @return {@link WxMpUserQuery}
|
||||||
*/
|
*/
|
||||||
public WxMpUserQuery remove(String openId) {
|
public WxMpUserQuery remove(String openId) {
|
||||||
queryParamList.remove(new WxMpUserQueryParam(openId));
|
queryParamList.remove(new WxMpUserQueryParam(openId));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除指定的OpenId
|
* 删除指定的OpenId
|
||||||
*
|
*
|
||||||
* @param openId
|
* @param openId
|
||||||
* @param lang 国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
|
* @param lang 国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
|
||||||
* @return {@link WxMpUserQuery}
|
* @return {@link WxMpUserQuery}
|
||||||
*/
|
*/
|
||||||
public WxMpUserQuery remove(String openId, String lang) {
|
public WxMpUserQuery remove(String openId, String lang) {
|
||||||
queryParamList.remove(new WxMpUserQueryParam(openId, lang));
|
queryParamList.remove(new WxMpUserQueryParam(openId, lang));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取查询参数列表
|
* 获取查询参数列表
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<WxMpUserQueryParam> getQueryParamList() {
|
public List<WxMpUserQueryParam> getQueryParamList() {
|
||||||
return queryParamList;
|
return queryParamList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toJsonString() {
|
public String toJsonString() {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("user_list", queryParamList);
|
map.put("user_list", queryParamList);
|
||||||
return new Gson().toJson(map);
|
return new Gson().toJson(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询参数封装
|
// 查询参数封装
|
||||||
public class WxMpUserQueryParam implements Serializable {
|
public class WxMpUserQueryParam implements Serializable {
|
||||||
/**
|
/**
|
||||||
* @fields serialVersionUID
|
* @fields serialVersionUID
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -6863571795702385319L;
|
private static final long serialVersionUID = -6863571795702385319L;
|
||||||
private String openid;
|
private String openid;
|
||||||
private String lang;
|
private String lang;
|
||||||
|
|
||||||
public WxMpUserQueryParam(String openid, String lang) {
|
public WxMpUserQueryParam(String openid, String lang) {
|
||||||
super();
|
super();
|
||||||
this.openid = openid;
|
this.openid = openid;
|
||||||
this.lang = lang;
|
this.lang = lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WxMpUserQueryParam(String openid) {
|
public WxMpUserQueryParam(String openid) {
|
||||||
super();
|
super();
|
||||||
this.openid = openid;
|
this.openid = openid;
|
||||||
this.lang = "zh_CN";
|
this.lang = "zh_CN";
|
||||||
}
|
}
|
||||||
|
|
||||||
public WxMpUserQueryParam() {
|
public WxMpUserQueryParam() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOpenid() {
|
public String getOpenid() {
|
||||||
return openid;
|
return openid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOpenid(String openid) {
|
public void setOpenid(String openid) {
|
||||||
this.openid = openid;
|
this.openid = openid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLang() {
|
public String getLang() {
|
||||||
return lang;
|
return lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLang(String lang) {
|
public void setLang(String lang) {
|
||||||
this.lang = lang;
|
this.lang = lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + getOuterType().hashCode();
|
result = prime * result + getOuterType().hashCode();
|
||||||
result = prime * result + ((lang == null) ? 0 : lang.hashCode());
|
result = prime * result + ((lang == null) ? 0 : lang.hashCode());
|
||||||
result = prime * result + ((openid == null) ? 0 : openid.hashCode());
|
result = prime * result + ((openid == null) ? 0 : openid.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj)
|
if (this == obj)
|
||||||
return true;
|
return true;
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
return false;
|
return false;
|
||||||
if (getClass() != obj.getClass())
|
if (getClass() != obj.getClass())
|
||||||
return false;
|
return false;
|
||||||
WxMpUserQueryParam other = (WxMpUserQueryParam) obj;
|
WxMpUserQueryParam other = (WxMpUserQueryParam) obj;
|
||||||
if (!getOuterType().equals(other.getOuterType()))
|
if (!getOuterType().equals(other.getOuterType()))
|
||||||
return false;
|
return false;
|
||||||
if (lang == null) {
|
if (lang == null) {
|
||||||
if (other.lang != null)
|
if (other.lang != null)
|
||||||
return false;
|
return false;
|
||||||
} else if (!lang.equals(other.lang))
|
} else if (!lang.equals(other.lang))
|
||||||
return false;
|
return false;
|
||||||
if (openid == null) {
|
if (openid == null) {
|
||||||
if (other.openid != null)
|
if (other.openid != null)
|
||||||
return false;
|
return false;
|
||||||
} else if (!openid.equals(other.openid))
|
} else if (!openid.equals(other.openid))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private WxMpUserQuery getOuterType() {
|
private WxMpUserQuery getOuterType() {
|
||||||
return WxMpUserQuery.this;
|
return WxMpUserQuery.this;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,164 +12,149 @@ import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信用户信息
|
* 微信用户信息
|
||||||
*
|
|
||||||
* @author chanjarster
|
* @author chanjarster
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class WxMpUser implements Serializable {
|
public class WxMpUser implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fields serialVersionUID
|
* @fields serialVersionUID
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 5788154322646488738L;
|
private static final long serialVersionUID = 5788154322646488738L;
|
||||||
protected Boolean subscribe;
|
protected Boolean subscribe;
|
||||||
protected String openId;
|
protected String openId;
|
||||||
protected String nickname;
|
protected String nickname;
|
||||||
protected String sex;
|
protected String sex;
|
||||||
protected String language;
|
protected String language;
|
||||||
protected String city;
|
protected String city;
|
||||||
protected String province;
|
protected String province;
|
||||||
protected String country;
|
protected String country;
|
||||||
protected String headImgUrl;
|
protected String headImgUrl;
|
||||||
protected Long subscribeTime;
|
protected Long subscribeTime;
|
||||||
protected String unionId;
|
protected String unionId;
|
||||||
protected Integer sexId;
|
protected Integer sexId;
|
||||||
protected String remark;
|
protected String remark;
|
||||||
protected Integer groupId;
|
protected Integer groupId;
|
||||||
|
|
||||||
public Boolean getSubscribe() {
|
public Boolean getSubscribe() {
|
||||||
return subscribe;
|
return subscribe;
|
||||||
}
|
}
|
||||||
|
public Boolean isSubscribe() {
|
||||||
|
return subscribe;
|
||||||
|
}
|
||||||
|
public void setSubscribe(Boolean subscribe) {
|
||||||
|
this.subscribe = subscribe;
|
||||||
|
}
|
||||||
|
public String getOpenId() {
|
||||||
|
return openId;
|
||||||
|
}
|
||||||
|
public void setOpenId(String openId) {
|
||||||
|
this.openId = openId;
|
||||||
|
}
|
||||||
|
public String getNickname() {
|
||||||
|
return nickname;
|
||||||
|
}
|
||||||
|
public void setNickname(String nickname) {
|
||||||
|
this.nickname = nickname;
|
||||||
|
}
|
||||||
|
public String getSex() {
|
||||||
|
return sex;
|
||||||
|
}
|
||||||
|
public void setSex(String sex) {
|
||||||
|
this.sex = sex;
|
||||||
|
}
|
||||||
|
public String getLanguage() {
|
||||||
|
return language;
|
||||||
|
}
|
||||||
|
public void setLanguage(String language) {
|
||||||
|
this.language = language;
|
||||||
|
}
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
public String getProvince() {
|
||||||
|
return province;
|
||||||
|
}
|
||||||
|
public void setProvince(String province) {
|
||||||
|
this.province = province;
|
||||||
|
}
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
public void setCountry(String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
public String getHeadImgUrl() {
|
||||||
|
return headImgUrl;
|
||||||
|
}
|
||||||
|
public void setHeadImgUrl(String headImgUrl) {
|
||||||
|
this.headImgUrl = headImgUrl;
|
||||||
|
}
|
||||||
|
public Long getSubscribeTime() {
|
||||||
|
return subscribeTime;
|
||||||
|
}
|
||||||
|
public void setSubscribeTime(Long subscribeTime) {
|
||||||
|
this.subscribeTime = subscribeTime;
|
||||||
|
}
|
||||||
|
public String getUnionId() {
|
||||||
|
return unionId;
|
||||||
|
}
|
||||||
|
public void setUnionId(String unionId) {
|
||||||
|
this.unionId = unionId;
|
||||||
|
}
|
||||||
|
|
||||||
public Boolean isSubscribe() {
|
public Integer getSexId() {
|
||||||
return subscribe;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSubscribe(Boolean subscribe) {
|
return sexId;
|
||||||
this.subscribe = subscribe;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public String getOpenId() {
|
public void setSexId(Integer sexId) {
|
||||||
return openId;
|
this.sexId = sexId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOpenId(String openId) {
|
public String getRemark() {
|
||||||
this.openId = openId;
|
return remark;
|
||||||
}
|
}
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
public Integer getGroupId() {
|
||||||
|
return groupId;
|
||||||
|
}
|
||||||
|
public void setGroupId(Integer groupId) {
|
||||||
|
this.groupId = groupId;
|
||||||
|
}
|
||||||
|
|
||||||
public String getNickname() {
|
public static WxMpUser fromJson(String json) {
|
||||||
return nickname;
|
return WxMpGsonBuilder.INSTANCE.create().fromJson(json, WxMpUser.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNickname(String nickname) {
|
public static List<WxMpUser> fromJsonList(String json) {
|
||||||
this.nickname = nickname;
|
Type collectionType = new TypeToken<List<WxMpUser>>() {}.getType();
|
||||||
}
|
Gson gson = WxMpGsonBuilder.INSTANCE.create();
|
||||||
|
JsonObject jsonObject = gson.fromJson(json, JsonObject.class);
|
||||||
|
return gson.fromJson(jsonObject.get("user_info_list"), collectionType);
|
||||||
|
}
|
||||||
|
|
||||||
public String getSex() {
|
@Override
|
||||||
return sex;
|
public String toString() {
|
||||||
}
|
return "WxMpUser{" +
|
||||||
|
"subscribe=" + subscribe +
|
||||||
public void setSex(String sex) {
|
", openId='" + openId + '\'' +
|
||||||
this.sex = sex;
|
", nickname='" + nickname + '\'' +
|
||||||
}
|
", sex='" + sex + '\'' +
|
||||||
|
", language='" + language + '\'' +
|
||||||
public String getLanguage() {
|
", city='" + city + '\'' +
|
||||||
return language;
|
", province='" + province + '\'' +
|
||||||
}
|
", country='" + country + '\'' +
|
||||||
|
", headImgUrl='" + headImgUrl + '\'' +
|
||||||
public void setLanguage(String language) {
|
", subscribeTime=" + subscribeTime +
|
||||||
this.language = language;
|
", unionId='" + unionId + '\'' +
|
||||||
}
|
", remark='" + remark + '\'' +
|
||||||
|
", groupId='" + groupId + '\'' +
|
||||||
public String getCity() {
|
'}';
|
||||||
return city;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void setCity(String city) {
|
|
||||||
this.city = city;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getProvince() {
|
|
||||||
return province;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProvince(String province) {
|
|
||||||
this.province = province;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCountry() {
|
|
||||||
return country;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCountry(String country) {
|
|
||||||
this.country = country;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getHeadImgUrl() {
|
|
||||||
return headImgUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHeadImgUrl(String headImgUrl) {
|
|
||||||
this.headImgUrl = headImgUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getSubscribeTime() {
|
|
||||||
return subscribeTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSubscribeTime(Long subscribeTime) {
|
|
||||||
this.subscribeTime = subscribeTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnionId() {
|
|
||||||
return unionId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUnionId(String unionId) {
|
|
||||||
this.unionId = unionId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getSexId() {
|
|
||||||
|
|
||||||
return sexId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSexId(Integer sexId) {
|
|
||||||
this.sexId = sexId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemark() {
|
|
||||||
return remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemark(String remark) {
|
|
||||||
this.remark = remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getGroupId() {
|
|
||||||
return groupId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGroupId(Integer groupId) {
|
|
||||||
this.groupId = groupId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static WxMpUser fromJson(String json) {
|
|
||||||
return WxMpGsonBuilder.INSTANCE.create().fromJson(json, WxMpUser.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<WxMpUser> fromJsonList(String json) {
|
|
||||||
Type collectionType = new TypeToken<List<WxMpUser>>() {
|
|
||||||
}.getType();
|
|
||||||
Gson gson = WxMpGsonBuilder.INSTANCE.create();
|
|
||||||
JsonObject jsonObject = gson.fromJson(json, JsonObject.class);
|
|
||||||
return gson.fromJson(jsonObject.get("user_info_list"), collectionType);
|
|
||||||
}
|
|
||||||
|
|
||||||
@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 + '\'' + ", remark='" + remark + '\'' + ", groupId='" + groupId + '\'' + '}';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user