Skip to content

Commit bc0fbf7

Browse files
committed
规范统一openid的问题 #177
1 parent 66f04c4 commit bc0fbf7

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/result/WxMpUserList.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public class WxMpUserList {
1414

1515
protected int total = -1;
1616
protected int count = -1;
17-
protected List<String> openIds = new ArrayList<>();
18-
protected String nextOpenId;
17+
protected List<String> openids = new ArrayList<>();
18+
protected String nextOpenid;
1919
public int getTotal() {
2020
return this.total;
2121
}
@@ -28,19 +28,19 @@ public int getCount() {
2828
public void setCount(int count) {
2929
this.count = count;
3030
}
31-
public List<String> getOpenIds() {
32-
return this.openIds;
31+
public List<String> getOpenids() {
32+
return this.openids;
3333
}
34-
public void setOpenIds(List<String> openIds) {
35-
this.openIds = openIds;
34+
public void setOpenids(List<String> openids) {
35+
this.openids = openids;
3636
}
37-
public String getNextOpenId() {
38-
return this.nextOpenId;
37+
public String getNextOpenid() {
38+
return this.nextOpenid;
3939
}
40-
public void setNextOpenId(String nextOpenId) {
41-
this.nextOpenId = nextOpenId;
40+
public void setNextOpenid(String nextOpenid) {
41+
this.nextOpenid = nextOpenid;
4242
}
43-
43+
4444
public static WxMpUserList fromJson(String json) {
4545
return WxMpGsonBuilder.INSTANCE.create().fromJson(json, WxMpUserList.class);
4646
}

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/json/WxUserListGsonAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ public WxMpUserList deserialize(JsonElement json, Type typeOfT, JsonDeserializat
2222
WxMpUserList wxMpUserList = new WxMpUserList();
2323
wxMpUserList.setTotal(GsonHelper.getInteger(o, "total"));
2424
wxMpUserList.setCount(GsonHelper.getInteger(o, "count"));
25-
wxMpUserList.setNextOpenId(GsonHelper.getString(o, "next_openid"));
25+
wxMpUserList.setNextOpenid(GsonHelper.getString(o, "next_openid"));
2626
if (o.get("data") != null && !o.get("data").isJsonNull() && !o.get("data").getAsJsonObject().get("openid").isJsonNull()) {
2727
JsonArray data = o.get("data").getAsJsonObject().get("openid").getAsJsonArray();
2828
for (int i = 0; i < data.size(); i++) {
29-
wxMpUserList.getOpenIds().add(GsonHelper.getAsString(data.get(i)));
29+
wxMpUserList.getOpenids().add(GsonHelper.getAsString(data.get(i)));
3030
}
3131
}
3232
return wxMpUserList;

weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpUserServiceImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void testUserList() throws WxErrorException {
7070
Assert.assertNotNull(wxMpUserList);
7171
Assert.assertFalse(wxMpUserList.getCount() == -1);
7272
Assert.assertFalse(wxMpUserList.getTotal() == -1);
73-
Assert.assertFalse(wxMpUserList.getOpenIds().size() == -1);
73+
Assert.assertFalse(wxMpUserList.getOpenids().size() == -1);
7474
System.out.println(wxMpUserList);
7575
}
7676

0 commit comments

Comments
 (0)