Skip to content

Commit 850c95a

Browse files
authored
🐛 #2056 【小程序】修复直播成员管理-查询成员列表请求参数的问题
1 parent 5155c8c commit 850c95a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaLiveMemberServiceImpl.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
import cn.binarywang.wx.miniapp.api.WxMaLiveMemberService;
44
import cn.binarywang.wx.miniapp.api.WxMaService;
55
import cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Broadcast.Role;
6+
import com.google.common.base.Joiner;
67
import com.google.gson.JsonArray;
78
import lombok.RequiredArgsConstructor;
89
import me.chanjar.weixin.common.error.WxErrorException;
910
import me.chanjar.weixin.common.util.json.GsonHelper;
1011
import me.chanjar.weixin.common.util.json.GsonParser;
1112

13+
import java.util.HashMap;
14+
import java.util.Map;
15+
1216
import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Broadcast.Role.LIST_BY_ROLE;
1317

1418
/**
@@ -35,8 +39,12 @@ public String deleteRole(String username, int role) throws WxErrorException {
3539

3640
@Override
3741
public JsonArray listByRole(Integer role, Integer offset, Integer limit, String keyword) throws WxErrorException {
38-
final String response = this.service.get(LIST_BY_ROLE, GsonHelper.buildJsonObject("role", role, "offset", offset,
39-
"limit", limit, "keyword", keyword).toString());
42+
Map<String, Object> params = new HashMap<>(8);
43+
params.put("role", role);
44+
params.put("offset", offset);
45+
params.put("limit", limit);
46+
params.put("keyword", keyword);
47+
final String response = this.service.get(LIST_BY_ROLE, Joiner.on("&").withKeyValueSeparator("=").join(params));
4048
return GsonParser.parse(response).getAsJsonArray("list");
4149
}
4250
}

0 commit comments

Comments
 (0)