1
0
mirror of synced 2025-12-16 20:28:11 +08:00

🐛 #2056 【小程序】修复直播成员管理-查询成员列表请求参数的问题

This commit is contained in:
banks
2021-03-29 17:12:52 +08:00
committed by GitHub
parent 5155c8c4b1
commit 850c95a042

View File

@@ -3,12 +3,16 @@ package cn.binarywang.wx.miniapp.api.impl;
import cn.binarywang.wx.miniapp.api.WxMaLiveMemberService;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Broadcast.Role;
import com.google.common.base.Joiner;
import com.google.gson.JsonArray;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.json.GsonHelper;
import me.chanjar.weixin.common.util.json.GsonParser;
import java.util.HashMap;
import java.util.Map;
import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Broadcast.Role.LIST_BY_ROLE;
/**
@@ -35,8 +39,12 @@ public class WxMaLiveMemberServiceImpl implements WxMaLiveMemberService {
@Override
public JsonArray listByRole(Integer role, Integer offset, Integer limit, String keyword) throws WxErrorException {
final String response = this.service.get(LIST_BY_ROLE, GsonHelper.buildJsonObject("role", role, "offset", offset,
"limit", limit, "keyword", keyword).toString());
Map<String, Object> params = new HashMap<>(8);
params.put("role", role);
params.put("offset", offset);
params.put("limit", limit);
params.put("keyword", keyword);
final String response = this.service.get(LIST_BY_ROLE, Joiner.on("&").withKeyValueSeparator("=").join(params));
return GsonParser.parse(response).getAsJsonArray("list");
}
}