From eb38e86a78467111d69b5706b2fb7c2d02cc02fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E7=A5=9E?= <981040863@qq.com> Date: Wed, 6 May 2020 11:01:12 +0800 Subject: [PATCH] =?UTF-8?q?:new:=20#1544=20=E5=BE=AE=E4=BF=A1=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E5=B9=B3=E5=8F=B0=E6=96=B0=E5=A2=9E=E4=BD=BF=E7=94=A8?= =?UTF-8?q?userstr=E5=8F=82=E6=95=B0=E8=A7=A3=E7=BB=91=E4=BD=93=E9=AA=8C?= =?UTF-8?q?=E8=80=85=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chanjar/weixin/open/api/WxOpenMaService.java | 8 ++++++++ .../weixin/open/api/impl/WxOpenMaServiceImpl.java | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java index 2b6e2d13a..c64156d04 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java @@ -295,6 +295,14 @@ public interface WxOpenMaService extends WxMaService { */ WxOpenResult unbindTester(String wechatid) throws WxErrorException; + /** + * 解除绑定小程序体验者,其他平台绑定的体验者无法获取到wechatid,可用此方法解绑,详见文档 + * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/unbind_tester.html + * + * @param userstr 人员对应的唯一字符串, 可通过获取已绑定的体验者列表获取人员对应的字符串 + */ + WxOpenResult unbindTesterByUserstr(String userstr) throws WxErrorException; + /** * 获得体验者列表 */ diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java index 1d30a57f1..6cbf584c3 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java @@ -194,6 +194,20 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } + /** + * 解除绑定小程序体验者 + * @param userstr 人员对应的唯一字符串, 可通过获取已绑定的体验者列表获取人员对应的字符串 + * @return + * @throws WxErrorException + */ + @Override + public WxOpenResult unbindTesterByUserstr(String userstr) throws WxErrorException { + JsonObject paramJson = new JsonObject(); + paramJson.addProperty("userstr", userstr); + String response = post(API_UNBIND_TESTER, GSON.toJson(paramJson)); + return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); + } + /** * 获得体验者列表 *