|
@@ -146,7 +146,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
|
|
|
//异步通讯录id转译
|
|
|
@Override
|
|
|
- public String syncTranslation(String mediaId,String outPutFileName,String outputFileFormat) throws Exception {
|
|
|
+ public String syncTranslation(String authCorpid, String mediaId,String outPutFileName,String outputFileFormat) throws Exception {
|
|
|
String url = "https://qyapi.weixin.qq.com/cgi-bin/service/contact/id_translate?provider_access_token=ACCESS_TOKEN".replaceAll("ACCESS_TOKEN",getProviderAccessToken());
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
List<String> list=new ArrayList<>();
|
|
@@ -154,9 +154,9 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
String jobid="";
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
JSONObject jsonObject=new JSONObject();
|
|
|
- jsonObject.put("auth_corpid",corpId);
|
|
|
+ jsonObject.put("auth_corpid",authCorpid);
|
|
|
jsonObject.put("media_id_list",list);
|
|
|
- jsonObject.put("output_file_name",outPutFileName);
|
|
|
+ /*jsonObject.put("output_file_name",outPutFileName);*/
|
|
|
/*jsonObject.put("output_file_format",outputFileFormat);*/
|
|
|
HttpEntity<String> requestEntity = new HttpEntity<String>(jsonObject.toJSONString(), headers);
|
|
|
ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
|
|
@@ -184,6 +184,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
|
|
|
HttpMethod.GET, requestEntity, String.class);
|
|
|
String resp = responseEntity.getBody();
|
|
|
+ System.out.println(resp);
|
|
|
JSONObject json = JSONObject.parseObject(resp);
|
|
|
if(json.getIntValue("errcode")==0){
|
|
|
JSONObject result = (JSONObject) json.get("result");
|
|
@@ -192,6 +193,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
}else {
|
|
|
throw new Exception(json.toJSONString());
|
|
|
}
|
|
|
+ System.out.println(resultUrl);
|
|
|
return resultUrl;
|
|
|
}
|
|
|
@Override
|