File tree 3 files changed +22
-4
lines changed
weixin-java-cp/src/main/java/me/chanjar/weixin/cp
3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,14 @@ public interface WxCpService extends WxService {
263
263
*/
264
264
String replaceParty (String mediaId ) throws WxErrorException ;
265
265
266
+ /**
267
+ * 上传用户列表,增量更新成员
268
+ * @param mediaId 媒体id
269
+ * @return jobId 异步任务id
270
+ * @throws WxErrorException the wx error exception
271
+ */
272
+ String syncUser (String mediaId ) throws WxErrorException ;
273
+
266
274
/**
267
275
* 上传用户列表覆盖企业号上的用户信息
268
276
*
@@ -275,11 +283,11 @@ public interface WxCpService extends WxService {
275
283
/**
276
284
* 获取异步任务结果
277
285
*
278
- * @param joinId the join id
286
+ * @param jobId 异步任务id
279
287
* @return the task result
280
288
* @throws WxErrorException the wx error exception
281
289
*/
282
- String getTaskResult (String joinId ) throws WxErrorException ;
290
+ String getTaskResult (String jobId ) throws WxErrorException ;
283
291
284
292
/**
285
293
* 初始化http请求对象
Original file line number Diff line number Diff line change @@ -408,6 +408,15 @@ public String replaceParty(String mediaId) throws WxErrorException {
408
408
return post (this .configStorage .getApiUrl (BATCH_REPLACE_PARTY ), jsonObject .toString ());
409
409
}
410
410
411
+ @ Override
412
+ public String syncUser (String mediaId ) throws WxErrorException {
413
+ JsonObject jsonObject = new JsonObject ();
414
+ jsonObject .addProperty ("media_id" , mediaId );
415
+ String responseContent = post (this .configStorage .getApiUrl (BATCH_SYNC_USER ), jsonObject .toString ());
416
+ JsonObject tmpJson = GsonParser .parse (responseContent );
417
+ return tmpJson .get ("jobid" ).getAsString ();
418
+ }
419
+
411
420
@ Override
412
421
public String replaceUser (String mediaId ) throws WxErrorException {
413
422
JsonObject jsonObject = new JsonObject ();
@@ -416,8 +425,8 @@ public String replaceUser(String mediaId) throws WxErrorException {
416
425
}
417
426
418
427
@ Override
419
- public String getTaskResult (String joinId ) throws WxErrorException {
420
- String url = this .configStorage .getApiUrl (BATCH_GET_RESULT + joinId );
428
+ public String getTaskResult (String jobId ) throws WxErrorException {
429
+ String url = this .configStorage .getApiUrl (BATCH_GET_RESULT + jobId );
421
430
return get (url , null );
422
431
}
423
432
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public interface WxCpApiPathConsts {
16
16
String GET_AGENT_CONFIG_TICKET = "/cgi-bin/ticket/get?&type=agent_config" ;
17
17
String GET_CALLBACK_IP = "/cgi-bin/getcallbackip" ;
18
18
String BATCH_REPLACE_PARTY = "/cgi-bin/batch/replaceparty" ;
19
+ String BATCH_SYNC_USER = "/cgi-bin/batch/syncuser" ;
19
20
String BATCH_REPLACE_USER = "/cgi-bin/batch/replaceuser" ;
20
21
String BATCH_GET_RESULT = "/cgi-bin/batch/getresult?jobid=" ;
21
22
String JSCODE_TO_SESSION = "/cgi-bin/miniprogram/jscode2session" ;
You can’t perform that action at this time.
0 commit comments