mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-09-24 04:53:50 +08:00
issue #1 添加分组管理接口-创建分组接口
This commit is contained in:
@@ -4,6 +4,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@@ -18,6 +19,7 @@ import org.apache.http.impl.client.HttpClients;
|
||||
|
||||
import chanjarster.weixin.bean.WxAccessToken;
|
||||
import chanjarster.weixin.bean.WxCustomMessage;
|
||||
import chanjarster.weixin.bean.WxGroup;
|
||||
import chanjarster.weixin.bean.WxMassGroupMessage;
|
||||
import chanjarster.weixin.bean.WxMassNews;
|
||||
import chanjarster.weixin.bean.WxMassOpenIdsMessage;
|
||||
@@ -183,6 +185,12 @@ public class WxServiceImpl implements WxService {
|
||||
return WxMassSendResult.fromJson(responseContent);
|
||||
}
|
||||
|
||||
public WxGroup groupCreate(String name) throws WxErrorException {
|
||||
String url = "https://api.weixin.qq.com/cgi-bin/groups/create";
|
||||
String responseContent = execute(new SimplePostRequestExecutor(), url, MessageFormat.format("'{'\"group\":'{'\"name\":\"{0}\"}}", name));
|
||||
return WxGroup.fromJson(responseContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 向微信端发送请求,在这里执行的策略是当发生access_token过期时才去刷新,然后重新执行请求,而不是全局定时请求
|
||||
* @param executor
|
||||
|
Reference in New Issue
Block a user