String url = "https://qyapi.weixin.qq.com/cgi-bin/user/batchdelete";
JsonObject jsonObject = new JsonObject();
JsonArray jsonArray = new JsonArray();
for (String userid : userIds) {
jsonArray.add(new JsonPrimitive(userid));
}
jsonObject.add("useridlist", jsonArray);
this.mainService.post(url, jsonObject.toString());
单个用户删除之后,还会再发一遍批量删除的请求
@OverRide
public void delete(String... userIds) throws WxErrorException {
if (userIds.length == 1) {
this.deleteOne(userIds[0]);
}
}