mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-07-15 23:13:31 +08:00
issue #78 删除接口支持批量操作
This commit is contained in:
parent
b8dd3662cd
commit
97dff44b3e
@ -249,6 +249,17 @@ public interface WxCpService {
|
||||
*/
|
||||
void userDelete(String userid) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 批量删除成员
|
||||
*
|
||||
* http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E6.89.B9.E9.87.8F.E5.88.A0.E9.99.A4.E6.88.90.E5.91.98
|
||||
* </pre>
|
||||
* @param userids 员工UserID列表。对应管理端的帐号
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
void userDelete(String[] userids) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取用户
|
||||
*
|
||||
|
@ -219,6 +219,18 @@ public class WxCpServiceImpl implements WxCpService {
|
||||
get(url, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userDelete(String[] userids) throws WxErrorException {
|
||||
String url = "https://qyapi.weixin.qq.com/cgi-bin/user/batchdelete";
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
JsonArray jsonArray = new JsonArray();
|
||||
for (int i = 0; i < userids.length; i++) {
|
||||
jsonArray.add(new JsonPrimitive(userids[i]));
|
||||
}
|
||||
jsonObject.add("useridlist", jsonArray);
|
||||
post(url, jsonObject.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpUser userGet(String userid) throws WxErrorException {
|
||||
String url = "https://qyapi.weixin.qq.com/cgi-bin/user/get?userid=" + userid;
|
||||
|
Loading…
Reference in New Issue
Block a user