增加查看通讯录全量更新结果的接口

This commit is contained in:
caosk 2015-08-15 20:05:32 +08:00
parent 57acfd5330
commit afaa0a3bde
2 changed files with 20 additions and 6 deletions

View File

@ -562,12 +562,20 @@ public interface WxCpService {
* @param mediaId
* @throws WxErrorException
*/
void replaceParty(String mediaId) throws WxErrorException;
String replaceParty(String mediaId) throws WxErrorException;
/**
* 上传用户列表覆盖企业号上的用户信息
* @param mediaId
* @throws WxErrorException
*/
void replaceUser(String mediaId) throws WxErrorException;
String replaceUser(String mediaId) throws WxErrorException;
/**
* 获取异步任务结果
* @param joinId
* @return
* @throws WxErrorException
*/
String getTaskResult(String joinId) throws WxErrorException;
}

View File

@ -656,19 +656,25 @@ public class WxCpServiceImpl implements WxCpService {
}
@Override
public void replaceParty(String mediaId) throws WxErrorException {
public String replaceParty(String mediaId) throws WxErrorException {
String url = "https://qyapi.weixin.qq.com/cgi-bin/batch/replaceparty";
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("media_id", mediaId);
post(url, jsonObject.toString());
return post(url, jsonObject.toString());
}
@Override
public void replaceUser(String mediaId) throws WxErrorException {
public String replaceUser(String mediaId) throws WxErrorException {
String url = "https://qyapi.weixin.qq.com/cgi-bin/batch/replaceuser";
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("media_id", mediaId);
post(url, jsonObject.toString());
return post(url, jsonObject.toString());
}
@Override
public String getTaskResult(String joinId) throws WxErrorException {
String url = "https://qyapi.weixin.qq.com/cgi-bin/batch/getresult?jobid="+joinId;
return get(url, null);
}
public File getTmpDirFile() {