File tree Expand file tree Collapse file tree
weixin-java-cp/src/main/java/me/chanjar/weixin/cp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,6 +263,14 @@ public interface WxCpService extends WxService {
263263 */
264264 String replaceParty (String mediaId ) throws WxErrorException ;
265265
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+
266274 /**
267275 * 上传用户列表覆盖企业号上的用户信息
268276 *
@@ -275,11 +283,11 @@ public interface WxCpService extends WxService {
275283 /**
276284 * 获取异步任务结果
277285 *
278- * @param joinId the join id
286+ * @param jobId 异步任务id
279287 * @return the task result
280288 * @throws WxErrorException the wx error exception
281289 */
282- String getTaskResult (String joinId ) throws WxErrorException ;
290+ String getTaskResult (String jobId ) throws WxErrorException ;
283291
284292 /**
285293 * 初始化http请求对象
Original file line number Diff line number Diff line change @@ -408,6 +408,15 @@ public String replaceParty(String mediaId) throws WxErrorException {
408408 return post (this .configStorage .getApiUrl (BATCH_REPLACE_PARTY ), jsonObject .toString ());
409409 }
410410
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+
411420 @ Override
412421 public String replaceUser (String mediaId ) throws WxErrorException {
413422 JsonObject jsonObject = new JsonObject ();
@@ -416,8 +425,8 @@ public String replaceUser(String mediaId) throws WxErrorException {
416425 }
417426
418427 @ 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 );
421430 return get (url , null );
422431 }
423432
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public interface WxCpApiPathConsts {
1616 String GET_AGENT_CONFIG_TICKET = "/cgi-bin/ticket/get?&type=agent_config" ;
1717 String GET_CALLBACK_IP = "/cgi-bin/getcallbackip" ;
1818 String BATCH_REPLACE_PARTY = "/cgi-bin/batch/replaceparty" ;
19+ String BATCH_SYNC_USER = "/cgi-bin/batch/syncuser" ;
1920 String BATCH_REPLACE_USER = "/cgi-bin/batch/replaceuser" ;
2021 String BATCH_GET_RESULT = "/cgi-bin/batch/getresult?jobid=" ;
2122 String JSCODE_TO_SESSION = "/cgi-bin/miniprogram/jscode2session" ;
You can’t perform that action at this time.
0 commit comments