From 93414199d62d34c6cf529712743c8b7fdfe74f47 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Sat, 6 Jun 2020 17:15:24 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E8=A7=84=E8=8C=83=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../open/api/WxOpenComponentService.java | 3 +- .../weixin/open/api/WxOpenMaService.java | 233 ++++++++---- .../api/impl/WxOpenComponentServiceImpl.java | 41 +- .../api/impl/WxOpenFastMaServiceImpl.java | 6 +- .../open/api/impl/WxOpenMaServiceImpl.java | 353 ++---------------- .../impl/WxOpenComponentServiceImplTest.java | 162 ++++++++ .../api/impl/WxOpenFastMaServiceImplTest.java | 218 +++++++++++ .../api/impl/WxOpenMaServiceImplTest.java | 334 +++++++++++++++++ 8 files changed, 935 insertions(+), 415 deletions(-) create mode 100644 weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImplTest.java create mode 100644 weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenFastMaServiceImplTest.java create mode 100644 weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImplTest.java diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenComponentService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenComponentService.java index 5f4994cd2..98ff8e038 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenComponentService.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenComponentService.java @@ -1,7 +1,6 @@ package me.chanjar.weixin.open.api; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; -import com.google.gson.JsonObject; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.mp.api.WxMpService; import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; @@ -10,7 +9,6 @@ import me.chanjar.weixin.open.bean.WxOpenGetResult; import me.chanjar.weixin.open.bean.WxOpenMaCodeTemplate; import me.chanjar.weixin.open.bean.message.WxOpenXmlMessage; import me.chanjar.weixin.open.bean.result.*; -import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder; import java.util.List; @@ -218,6 +216,7 @@ public interface WxOpenComponentService { * * @param appId 公众号/小程序的appId * @return . + * @throws WxErrorException . */ WxOpenCreateResult createOpenAccount(String appId) throws WxErrorException; 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 c64156d04..ccaeeff01 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 @@ -17,10 +17,9 @@ import java.util.Map; * * * @author yqx - * @date 2018/9/12 + * @date 2018 /9/12 */ public interface WxOpenMaService extends WxMaService { - /** * 设置小程序服务器域名. * @@ -73,11 +72,8 @@ public interface WxOpenMaService extends WxMaService { /** * 以下接口基础信息设置 *

- * https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=21517799059ZSEMr&token=6f965b5daf30a98a6bbd2a386faea5c934e929bf&lang=zh_CN + * https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=21517799059ZSEMr&token=6f965b5daf30a98a6bbd2a386faea5c934e929bf&lang=zh_CN *

- */ - - /** * 1. 设置小程序隐私设置(是否可被搜索) */ String API_CHANGE_WXA_SEARCH_STATUS = "https://api.weixin.qq.com/wxa/changewxasearchstatus"; @@ -101,11 +97,8 @@ public interface WxOpenMaService extends WxMaService { /** * 以下接口为三方平台代小程序实现的代码管理功能 *

- * https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1489140610_Uavc4&token=fe774228c66725425675810097f9e48d0737a4bf&lang=zh_CN + * https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1489140610_Uavc4&token=fe774228c66725425675810097f9e48d0737a4bf&lang=zh_CN *

- */ - - /** * 1. 为授权的小程序帐号上传小程序代码 */ String API_CODE_COMMIT = "https://api.weixin.qq.com/wxa/commit"; @@ -167,10 +160,8 @@ public interface WxOpenMaService extends WxMaService { /** * 14.设置小程序“扫普通链接二维码打开小程序”能力 - * + *

* https://mp.weixin.qq.com/debug/wxadoc/introduction/qrcode.html - */ - /** * 14.1 增加或修改二维码规则 */ String API_QRCODE_JUMP_ADD = "https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpadd"; @@ -229,112 +220,142 @@ public interface WxOpenMaService extends WxMaService { */ String API_SPEED_AUDIT = "https://api.weixin.qq.com/wxa/speedupaudit"; - /** * 获得小程序的域名配置信息 + * + * @return the domain + * @throws WxErrorException the wx error exception */ WxOpenMaDomainResult getDomain() throws WxErrorException; /** * 修改域名 * - * @param action delete删除, set覆盖, get获取 + * @param action delete删除, set覆盖, get获取 + * @param requestDomains the requestdomain list + * @param wsRequestDomains the wsrequestdomain list + * @param uploadDomains the uploaddomain list + * @param downloadDomains the downloaddomain list + * @return the wx open ma domain result + * @throws WxErrorException the wx error exception */ - WxOpenMaDomainResult modifyDomain(String action, List requestdomainList, List wsrequestdomainList, List uploaddomainList, List downloaddomainList) throws WxErrorException; + WxOpenMaDomainResult modifyDomain(String action, List requestDomains, List wsRequestDomains, + List uploadDomains, List downloadDomains) throws WxErrorException; /** * 获取小程序的业务域名 * - * @return 直接返回字符串 + * @return 直接返回字符串 web view domain + * @throws WxErrorException the wx error exception */ String getWebViewDomain() throws WxErrorException; /** * 获取小程序的业务域名 * - * @return + * @return web view domain info + * @throws WxErrorException the wx error exception */ - public WxOpenMaWebDomainResult getWebViewDomainInfo() throws WxErrorException; - - /** - * 设置小程序的业务域名 - * - * @param action add添加, delete删除, set覆盖 - * @return 直接返回字符串 - */ - String setWebViewDomain(String action, List domainList) throws WxErrorException; - + WxOpenMaWebDomainResult getWebViewDomainInfo() throws WxErrorException; /** * 设置小程序的业务域名 * * @param action add添加, delete删除, set覆盖 - * @param domainList - * @return + * @param domainList the domain list + * @return 直接返回字符串 web view domain + * @throws WxErrorException the wx error exception + */ + String setWebViewDomain(String action, List domainList) throws WxErrorException; + + /** + * 设置小程序的业务域名 + * + * @param action add添加, delete删除, set覆盖 + * @param domainList the domain list + * @return web view domain info + * @throws WxErrorException the wx error exception */ WxOpenMaWebDomainResult setWebViewDomainInfo(String action, List domainList) throws WxErrorException; /** * 获取小程序的信息 + * + * @return the account basic info + * @throws WxErrorException the wx error exception */ String getAccountBasicInfo() throws WxErrorException; /** * 绑定小程序体验者 * - * @param wechatid 体验者微信号(不是openid) - * @return - * @throws WxErrorException + * @param wechatId 体验者微信号(不是openid) + * @return wx open ma bind tester result + * @throws WxErrorException the wx error exception */ - WxOpenMaBindTesterResult bindTester(String wechatid) throws WxErrorException; + WxOpenMaBindTesterResult bindTester(String wechatId) throws WxErrorException; /** * 解除绑定小程序体验者 * - * @param wechatid 体验者微信号(不是openid) + * @param wechatId 体验者微信号(不是openid) + * @return the wx open result + * @throws WxErrorException the wx error exception */ - WxOpenResult unbindTester(String wechatid) throws WxErrorException; + WxOpenResult unbindTester(String wechatId) throws WxErrorException; /** * 解除绑定小程序体验者,其他平台绑定的体验者无法获取到wechatid,可用此方法解绑,详见文档 * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/unbind_tester.html * - * @param userstr 人员对应的唯一字符串, 可通过获取已绑定的体验者列表获取人员对应的字符串 + * @param userStr 人员对应的唯一字符串, 可通过获取已绑定的体验者列表获取人员对应的字符串 + * @return the wx open result + * @throws WxErrorException the wx error exception */ - WxOpenResult unbindTesterByUserstr(String userstr) throws WxErrorException; + WxOpenResult unbindTesterByUserStr(String userStr) throws WxErrorException; /** * 获得体验者列表 + * + * @return the tester list + * @throws WxErrorException the wx error exception */ WxOpenMaTesterListResult getTesterList() throws WxErrorException; - /** * 设置小程序隐私设置(是否可被搜索) * * @param status 1表示不可搜索,0表示可搜索 + * @return the wx open result + * @throws WxErrorException the wx error exception */ - public WxOpenResult changeWxaSearchStatus(Integer status) throws WxErrorException; - + WxOpenResult changeWxaSearchStatus(Integer status) throws WxErrorException; /** * 2. 查询小程序当前隐私设置(是否可被搜索) + * + * @return the wxa search status + * @throws WxErrorException the wx error exception */ - public WxOpenMaSearchStatusResult getWxaSearchStatus() throws WxErrorException; + WxOpenMaSearchStatusResult getWxaSearchStatus() throws WxErrorException; /** * 3.1 获取展示的公众号信息 + * + * @return the show wxa item + * @throws WxErrorException the wx error exception */ - public WxOpenMaShowItemResult getShowWxaItem() throws WxErrorException; - + WxOpenMaShowItemResult getShowWxaItem() throws WxErrorException; /** * 3.2 设置展示的公众号 * * @param flag 0 关闭,1 开启 - * @param mpappid 如果开启,需要传新的公众号appid + * @param mpAppId 如果开启,需要传新的公众号appid + * @return the wx open result + * @throws WxErrorException the wx error exception */ - public WxOpenResult updateShowwxaitem(Integer flag, String mpappid) throws WxErrorException; + WxOpenResult updateShowWxaItem(Integer flag, String mpAppId) throws WxErrorException; /** * 1、为授权的小程序帐号上传小程序代码 @@ -343,11 +364,18 @@ public interface WxOpenMaService extends WxMaService { * @param userVersion 用户定义版本 * @param userDesc 用户定义版本描述 * @param extInfo 第三方自定义的配置 + * @return the wx open result + * @throws WxErrorException the wx error exception */ WxOpenResult codeCommit(Long templateId, String userVersion, String userDesc, WxMaOpenCommitExtInfo extInfo) throws WxErrorException; /** * 获取体验小程序的体验二维码 + * + * @param pagePath the page path + * @param params the params + * @return the test qrcode + * @throws WxErrorException the wx error exception */ File getTestQrcode(String pagePath, Map params) throws WxErrorException; @@ -356,124 +384,203 @@ public interface WxOpenMaService extends WxMaService { *

* 注意:该接口可获取已设置的二级类目及用于代码审核的可选三级类目。 *

+ * + * @return the category list + * @throws WxErrorException the wx error exception */ WxOpenMaCategoryListResult getCategoryList() throws WxErrorException; /** * 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用) * - * @return - * @throws WxErrorException + * @return page list + * @throws WxErrorException the wx error exception */ WxOpenMaPageListResult getPageList() throws WxErrorException; /** * 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用) + * + * @param submitAuditMessage the submit audit message + * @return the wx open ma submit audit result + * @throws WxErrorException the wx error exception */ WxOpenMaSubmitAuditResult submitAudit(WxOpenMaSubmitAuditMessage submitAuditMessage) throws WxErrorException; /** * 查询某个指定版本的审核状态(仅供第三方代小程序调用) + * + * @param auditId the auditid + * @return the audit status + * @throws WxErrorException the wx error exception */ - WxOpenMaQueryAuditResult getAuditStatus(Long auditid) throws WxErrorException; + WxOpenMaQueryAuditResult getAuditStatus(Long auditId) throws WxErrorException; /** - * 查询最新一次提交的审核状态(仅供第三方代小程序调用). + * 8. 查询最新一次提交的审核状态(仅供第三方代小程序调用) + * + * @return 。 + * @throws WxErrorException 。 */ WxOpenMaQueryAuditResult getLatestAuditStatus() throws WxErrorException; /** - * 发布已通过审核的小程序(仅供第三方代小程序调用). + * 9. 发布已通过审核的小程序(仅供第三方代小程序调用) + *

+ * 请填写空的数据包,POST的json数据包为空即可。 + *

+ * + * @return 。 + * @throws WxErrorException 。 */ - WxOpenResult releaesAudited() throws WxErrorException; + WxOpenResult releaseAudited() throws WxErrorException; /** * 10. 修改小程序线上代码的可见状态(仅供第三方代小程序调用) + * + * @param action the action + * @return the wx open result + * @throws WxErrorException the wx error exception */ - public WxOpenResult changeVisitstatus(String action) throws WxErrorException; - + WxOpenResult changeVisitStatus(String action) throws WxErrorException; /** * 11. 小程序版本回退(仅供第三方代小程序调用) + * + * @return 。 + * @throws WxErrorException 。 */ - WxOpenResult revertCodeReleaes() throws WxErrorException; + WxOpenResult revertCodeRelease() throws WxErrorException; /** * 15. 小程序审核撤回 + *

* 单个帐号每天审核撤回次数最多不超过1次,一个月不超过10次。 + *

+ * + * @return 。 + * @throws WxErrorException 。 */ WxOpenResult undoCodeAudit() throws WxErrorException; /** - * 查询当前设置的最低基础库版本及各版本用户占比 (仅供第三方代小程序调用) + * 12. 查询当前设置的最低基础库版本及各版本用户占比 (仅供第三方代小程序调用) + * + * @return 。 + * @throws WxErrorException 。 */ String getSupportVersion() throws WxErrorException; /** - * 查询当前设置的最低基础库版本及各版本用户占比 (仅供第三方代小程序调用) + * 12. 查询当前设置的最低基础库版本及各版本用户占比 (仅供第三方代小程序调用) + * + * @return . support version info + * @throws WxErrorException . */ WxOpenMaWeappSupportVersionResult getSupportVersionInfo() throws WxErrorException; /** * 设置最低基础库版本(仅供第三方代小程序调用) + * + * @param version the version + * @return the support version + * @throws WxErrorException the wx error exception */ String setSupportVersion(String version) throws WxErrorException; /** - * 设置最低基础库版本(仅供第三方代小程序调用) + * 13. 设置最低基础库版本(仅供第三方代小程序调用) + * + * @param version the version + * @return support version info + * @throws WxErrorException the wx error exception */ WxOpenResult setSupportVersionInfo(String version) throws WxErrorException; /** * 16. 小程序分阶段发布 - 1)分阶段发布接口 + * + * @param grayPercentage 灰度的百分比,1到100的整数 + * @return . wx open result + * @throws WxErrorException . */ - WxOpenResult grayrelease(Integer grayPercentage) throws WxErrorException; + WxOpenResult grayRelease(Integer grayPercentage) throws WxErrorException; /** * 16. 小程序分阶段发布 - 2)取消分阶段发布 + * + * @return . wx open result + * @throws WxErrorException . */ - WxOpenResult revertgrayrelease() throws WxErrorException; + WxOpenResult revertGrayRelease() throws WxErrorException; /** * 16. 小程序分阶段发布 - 3)查询当前分阶段发布详情 + * + * @return . gray release plan + * @throws WxErrorException . */ - WxOpenMaGrayReleasePlanResult getgrayreleaseplan() throws WxErrorException; - + WxOpenMaGrayReleasePlanResult getGrayReleasePlan() throws WxErrorException; /** * 查询服务商的当月提审限额和加急次数(Quota) * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/code/query_quota.html + * + * @return the wx open ma query quota result + * @throws WxErrorException the wx error exception */ WxOpenMaQueryQuotaResult queryQuota() throws WxErrorException; /** * 加急审核申请 * 有加急次数的第三方可以通过该接口,对已经提审的小程序进行加急操作,加急后的小程序预计2-12小时内审完。 + * + * @param auditId the auditid + * @return the boolean + * @throws WxErrorException the wx error exception */ - Boolean speedAudit(Long auditid) throws WxErrorException; + Boolean speedAudit(Long auditId) throws WxErrorException; /** * (1)增加或修改二维码规则 + * + * @param wxQrcodeJumpRule the wx qrcode jump rule + * @return the wx open result + * @throws WxErrorException the wx error exception */ WxOpenResult addQrcodeJump(WxQrcodeJumpRule wxQrcodeJumpRule) throws WxErrorException; /** * (2)获取已设置的二维码规则 + * + * @return the qrcode jump + * @throws WxErrorException the wx error exception */ WxGetQrcodeJumpResult getQrcodeJump() throws WxErrorException; /** * (3)获取校验文件名称及内容 + * + * @return the wx downlooad qrcode jump result + * @throws WxErrorException the wx error exception */ WxDownlooadQrcodeJumpResult downloadQrcodeJump() throws WxErrorException; /** * (4)删除已设置的二维码规则 + * + * @param prefix the prefix + * @return the wx open result + * @throws WxErrorException the wx error exception */ WxOpenResult deleteQrcodeJump(String prefix) throws WxErrorException; /** * (5)发布已设置的二维码规则 + * + * @param prefix the prefix + * @return the wx open result + * @throws WxErrorException the wx error exception */ WxOpenResult publishQrcodeJump(String prefix) throws WxErrorException; } diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImpl.java index 82032eaf6..e111b5a18 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImpl.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImpl.java @@ -4,6 +4,8 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.reflect.TypeToken; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxError; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.util.crypto.SHA1; @@ -18,8 +20,6 @@ import me.chanjar.weixin.open.bean.message.WxOpenXmlMessage; import me.chanjar.weixin.open.bean.result.*; import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.List; import java.util.Map; @@ -30,18 +30,15 @@ import java.util.concurrent.locks.Lock; /** * @author 007 */ +@Slf4j +@AllArgsConstructor public class WxOpenComponentServiceImpl implements WxOpenComponentService { private static final JsonParser JSON_PARSER = new JsonParser(); private static final Map WX_OPEN_MA_SERVICE_MAP = new ConcurrentHashMap<>(); private static final Map WX_OPEN_MP_SERVICE_MAP = new ConcurrentHashMap<>(); private static final Map WX_OPEN_FAST_MA_SERVICE_MAP = new ConcurrentHashMap<>(); - protected final Logger log = LoggerFactory.getLogger(this.getClass()); - private WxOpenService wxOpenService; - - public WxOpenComponentServiceImpl(WxOpenService wxOpenService) { - this.wxOpenService = wxOpenService; - } + private final WxOpenService wxOpenService; @Override public WxMpService getWxMpServiceByAppid(String appId) { @@ -228,41 +225,33 @@ public class WxOpenComponentServiceImpl implements WxOpenComponentService { } @Override - public String getPreAuthUrl(String redirectURI, String authType, String bizAppid) throws WxErrorException { - return createPreAuthUrl(redirectURI, authType, bizAppid, false); + public String getPreAuthUrl(String redirectUri, String authType, String bizAppid) throws WxErrorException { + return createPreAuthUrl(redirectUri, authType, bizAppid, false); } @Override - public String getMobilePreAuthUrl(String redirectURI) throws WxErrorException { - return getMobilePreAuthUrl(redirectURI, null, null); + public String getMobilePreAuthUrl(String redirectUri) throws WxErrorException { + return getMobilePreAuthUrl(redirectUri, null, null); } @Override - public String getMobilePreAuthUrl(String redirectURI, String authType, String bizAppid) throws WxErrorException { - return createPreAuthUrl(redirectURI, authType, bizAppid, true); + public String getMobilePreAuthUrl(String redirectUri, String authType, String bizAppid) throws WxErrorException { + return createPreAuthUrl(redirectUri, authType, bizAppid, true); } /** * 创建预授权链接 - * - * @param redirectURI - * @param authType - * @param bizAppid - * @param isMobile 是否移动端预授权 - * @return - * @throws WxErrorException */ - private String createPreAuthUrl(String redirectURI, String authType, String bizAppid, boolean isMobile) throws WxErrorException { + private String createPreAuthUrl(String redirectUri, String authType, String bizAppid, boolean isMobile) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("component_appid", getWxOpenConfigStorage().getComponentAppId()); String responseContent = post(API_CREATE_PREAUTHCODE_URL, jsonObject.toString()); jsonObject = WxGsonBuilder.create().fromJson(responseContent, JsonObject.class); - StringBuilder preAuthUrl = new StringBuilder(String.format((isMobile ? COMPONENT_MOBILE_LOGIN_PAGE_URL : COMPONENT_LOGIN_PAGE_URL), + String preAuthUrlStr = String.format((isMobile ? COMPONENT_MOBILE_LOGIN_PAGE_URL : COMPONENT_LOGIN_PAGE_URL), getWxOpenConfigStorage().getComponentAppId(), jsonObject.get("pre_auth_code").getAsString(), - URIUtil.encodeURIComponent(redirectURI))); - String preAuthUrlStr = preAuthUrl.toString(); + URIUtil.encodeURIComponent(redirectUri)); if (StringUtils.isNotEmpty(authType)) { preAuthUrlStr = preAuthUrlStr.replace("&auth_type=xxx", "&auth_type=" + authType); } else { @@ -337,7 +326,7 @@ public class WxOpenComponentServiceImpl implements WxOpenComponentService { @Override public WxOpenAuthorizerListResult getAuthorizerList(int begin, int len) throws WxErrorException { - begin = begin < 0 ? 0 : begin; + begin = Math.max(begin, 0); len = len == 0 ? 10 : len; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("component_appid", getWxOpenConfigStorage().getComponentAppId()); diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenFastMaServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenFastMaServiceImpl.java index 01a808ed8..2cea9530b 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenFastMaServiceImpl.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenFastMaServiceImpl.java @@ -22,9 +22,9 @@ import java.util.Map; * @since 2019/1/23 15:27 */ public class WxOpenFastMaServiceImpl extends WxMaServiceImpl implements WxOpenFastMaService { - private WxOpenComponentService wxOpenComponentService; - private WxMaConfig wxMaConfig; - private String appId; + private final WxOpenComponentService wxOpenComponentService; + private final WxMaConfig wxMaConfig; + private final String appId; public WxOpenFastMaServiceImpl(WxOpenComponentService wxOpenComponentService, String appId, WxMaConfig wxMaConfig) { this.wxOpenComponentService = wxOpenComponentService; 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 af3f37b79..a8c252bae 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 @@ -21,18 +21,19 @@ import java.util.List; import java.util.Map; /** - * @author 007 *
  *     增加开放平台代小程序管理服务能力
  *     说明:这里让这个服务公开便于调用者模拟本地测试服务
  * 
+ * + * @author 007 * @author yqx * @date 2018-09-12 */ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaService { - private WxOpenComponentService wxOpenComponentService; - private WxMaConfig wxMaConfig; - private String appId; + private final WxOpenComponentService wxOpenComponentService; + private final WxMaConfig wxMaConfig; + private final String appId; public WxOpenMaServiceImpl(WxOpenComponentService wxOpenComponentService, String appId, WxMaConfig wxMaConfig) { this.wxOpenComponentService = wxOpenComponentService; @@ -56,72 +57,38 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ return wxOpenComponentService.getAuthorizerAccessToken(appId, forceRefresh); } - /** - * 获得小程序的域名配置信息 - * - * @return - */ @Override public WxOpenMaDomainResult getDomain() throws WxErrorException { return modifyDomain("get", null, null, null, null); } - /** - * 修改服务器域名 - * - * @param action delete删除, set覆盖, get获取 - * @param requestdomainList - * @param wsrequestdomainList - * @param uploaddomainList - * @param downloaddomainList - * @return - * @throws WxErrorException - */ @Override - public WxOpenMaDomainResult modifyDomain(String action, List requestdomainList, List wsrequestdomainList, List uploaddomainList, List downloaddomainList) throws WxErrorException { - + public WxOpenMaDomainResult modifyDomain(String action, List requestDomains, List wsRequestDomains, List uploadDomains, List downloadDomains) throws WxErrorException { // if (!"get".equals(action) && (requestdomainList == null || wsrequestdomainList == null || uploaddomainList == null || downloaddomainList == null)) { // throw new WxErrorException(WxError.builder().errorCode(44004).errorMsg("域名参数不能为空").build()); // } JsonObject requestJson = new JsonObject(); requestJson.addProperty("action", action); if (!"get".equals(action)) { - requestJson.add("requestdomain", toJsonArray(requestdomainList)); - requestJson.add("wsrequestdomain", toJsonArray(wsrequestdomainList)); - requestJson.add("uploaddomain", toJsonArray(uploaddomainList)); - requestJson.add("downloaddomain", toJsonArray(downloaddomainList)); + requestJson.add("requestdomain", toJsonArray(requestDomains)); + requestJson.add("wsrequestdomain", toJsonArray(wsRequestDomains)); + requestJson.add("uploaddomain", toJsonArray(uploadDomains)); + requestJson.add("downloaddomain", toJsonArray(downloadDomains)); } String response = post(API_MODIFY_DOMAIN, GSON.toJson(requestJson)); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaDomainResult.class); } - /** - * 获取小程序的业务域名 - * - * @return - */ @Override public String getWebViewDomain() throws WxErrorException { return setWebViewDomain("get", null); } - /** - * 获取小程序的业务域名 - * - * @return - */ @Override public WxOpenMaWebDomainResult getWebViewDomainInfo() throws WxErrorException { return setWebViewDomainInfo("get", null); } - /** - * 设置小程序的业务域名 - * - * @param action add添加, delete删除, set覆盖 - * @param domainList - * @return - */ @Override public String setWebViewDomain(String action, List domainList) throws WxErrorException { JsonObject requestJson = new JsonObject(); @@ -129,18 +96,10 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ if (!"get".equals(action)) { requestJson.add("webviewdomain", toJsonArray(domainList)); } - String response = post(API_SET_WEBVIEW_DOMAIN, GSON.toJson(requestJson)); - //TODO 转化为对象返回 - return response; + return post(API_SET_WEBVIEW_DOMAIN, GSON.toJson(requestJson)); } - /** - * 设置小程序的业务域名 - * - * @param action add添加, delete删除, set覆盖 - * @return - */ @Override public WxOpenMaWebDomainResult setWebViewDomainInfo(String action, List domainList) throws WxErrorException { String response = this.setWebViewDomain(action, domainList); @@ -148,74 +107,36 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ } - /** - * 获取小程序的信息,GET请求 - *
-   *     注意:这里不能直接用小程序的access_token
-   *     //TODO 待调整
-   * 
- * - * @return - * @throws WxErrorException - */ @Override public String getAccountBasicInfo() throws WxErrorException { - String response = get(API_GET_ACCOUNT_BASICINFO, ""); - return response; + return get(API_GET_ACCOUNT_BASICINFO, ""); } - /** - * 绑定小程序体验者 - * - * @param wechatid 体验者微信号(不是openid) - * @return - * @throws WxErrorException - */ @Override - public WxOpenMaBindTesterResult bindTester(String wechatid) throws WxErrorException { + public WxOpenMaBindTesterResult bindTester(String wechatId) throws WxErrorException { JsonObject paramJson = new JsonObject(); - paramJson.addProperty("wechatid", wechatid); + paramJson.addProperty("wechatid", wechatId); String response = post(API_BIND_TESTER, GSON.toJson(paramJson)); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaBindTesterResult.class); } - /** - * 解除绑定小程序体验者 - * - * @param wechatid 体验者微信号(不是openid) - * @return - * @throws WxErrorException - */ @Override - public WxOpenResult unbindTester(String wechatid) throws WxErrorException { + public WxOpenResult unbindTester(String wechatId) throws WxErrorException { JsonObject paramJson = new JsonObject(); - paramJson.addProperty("wechatid", wechatid); + paramJson.addProperty("wechatid", wechatId); String response = post(API_UNBIND_TESTER, GSON.toJson(paramJson)); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - /** - * 解除绑定小程序体验者 - * - * @param userstr 人员对应的唯一字符串, 可通过获取已绑定的体验者列表获取人员对应的字符串 - * @return - * @throws WxErrorException - */ @Override - public WxOpenResult unbindTesterByUserstr(String userstr) throws WxErrorException { + public WxOpenResult unbindTesterByUserStr(String userStr) throws WxErrorException { JsonObject paramJson = new JsonObject(); - paramJson.addProperty("userstr", userstr); + paramJson.addProperty("userstr", userStr); String response = post(API_UNBIND_TESTER, GSON.toJson(paramJson)); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - /** - * 获得体验者列表 - * - * @return - * @throws WxErrorException - */ @Override public WxOpenMaTesterListResult getTesterList() throws WxErrorException { JsonObject paramJson = new JsonObject(); @@ -224,12 +145,6 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ return WxMaGsonBuilder.create().fromJson(response, WxOpenMaTesterListResult.class); } - - /** - * 设置小程序隐私设置(是否可被搜索) - * - * @param status 1表示不可搜索,0表示可搜索 - */ @Override public WxOpenResult changeWxaSearchStatus(Integer status) throws WxErrorException { JsonObject paramJson = new JsonObject(); @@ -238,53 +153,27 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - - /** - * 2. 查询小程序当前隐私设置(是否可被搜索) - */ @Override public WxOpenMaSearchStatusResult getWxaSearchStatus() throws WxErrorException { String response = get(API_GET_WXA_SEARCH_STATUS, null); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaSearchStatusResult.class); } - - /** - * 3.1 获取展示的公众号信息 - */ @Override public WxOpenMaShowItemResult getShowWxaItem() throws WxErrorException { String response = get(API_GET_SHOW_WXA_ITEM, null); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaShowItemResult.class); } - - /** - * 3.2 设置展示的公众号 - * - * @param flag 0 关闭,1 开启 - * @param mpappid 如果开启,需要传新的公众号appid - */ @Override - public WxOpenResult updateShowwxaitem(Integer flag, String mpappid) throws WxErrorException { + public WxOpenResult updateShowWxaItem(Integer flag, String mpAppId) throws WxErrorException { JsonObject paramJson = new JsonObject(); paramJson.addProperty("wxa_subscribe_biz_flag", flag); - paramJson.addProperty("appid", mpappid); + paramJson.addProperty("appid", mpAppId); String response = post(API_UPDATE_SHOW_WXA_ITEM, GSON.toJson(paramJson)); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - - /** - * 1、为授权的小程序帐号上传小程序代码 - * - * @param templateId 代码模板ID - * @param userVersion 用户定义版本 - * @param userDesc 用户定义版本描述 - * @param extInfo 第三方自定义的配置 - * @return - * @throws WxErrorException - */ @Override public WxOpenResult codeCommit(Long templateId, String userVersion, String userDesc, WxMaOpenCommitExtInfo extInfo) throws WxErrorException { JsonObject params = new JsonObject(); @@ -297,13 +186,6 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - /** - * 获取体验小程序的体验二维码 - * - * @param pagePath - * @param params - * @return - */ @Override public File getTestQrcode(String pagePath, Map params) throws WxErrorException { WxMaQrcodeParam qrcodeParam = WxMaQrcodeParam.create(pagePath); @@ -312,302 +194,144 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ return wxMaService.execute(MaQrCodeRequestExecutor.create(getRequestHttp()), API_TEST_QRCODE, qrcodeParam); } - /** - * 获取授权小程序帐号的可选类目 - *

- * 注意:该接口可获取已设置的二级类目及用于代码审核的可选三级类目。 - *

- * - * @return WxOpenMaCategoryListResult - * @throws WxErrorException - */ @Override public WxOpenMaCategoryListResult getCategoryList() throws WxErrorException { String response = get(API_GET_CATEGORY, null); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaCategoryListResult.class); } - /** - * 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用) - * - * @return - * @throws WxErrorException - */ @Override public WxOpenMaPageListResult getPageList() throws WxErrorException { String response = get(API_GET_PAGE, null); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaPageListResult.class); } - /** - * 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用) - * - * @param submitAuditMessage - * @return - * @throws WxErrorException - */ @Override public WxOpenMaSubmitAuditResult submitAudit(WxOpenMaSubmitAuditMessage submitAuditMessage) throws WxErrorException { String response = post(API_SUBMIT_AUDIT, GSON.toJson(submitAuditMessage)); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaSubmitAuditResult.class); } - /** - * 7. 查询某个指定版本的审核状态(仅供第三方代小程序调用) - * - * @param auditid - * @return - * @throws WxErrorException - */ @Override - public WxOpenMaQueryAuditResult getAuditStatus(Long auditid) throws WxErrorException { + public WxOpenMaQueryAuditResult getAuditStatus(Long auditId) throws WxErrorException { JsonObject params = new JsonObject(); - params.addProperty("auditid", auditid); + params.addProperty("auditid", auditId); String response = post(API_GET_AUDIT_STATUS, GSON.toJson(params)); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaQueryAuditResult.class); } - /** - * 8. 查询最新一次提交的审核状态(仅供第三方代小程序调用) - * - * @return - * @throws WxErrorException - */ @Override public WxOpenMaQueryAuditResult getLatestAuditStatus() throws WxErrorException { String response = get(API_GET_LATEST_AUDIT_STATUS, null); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaQueryAuditResult.class); } - /** - * 9. 发布已通过审核的小程序(仅供第三方代小程序调用) - *

- * 请填写空的数据包,POST的json数据包为空即可。 - *

- * - * @return - * @throws WxErrorException - */ @Override - public WxOpenResult releaesAudited() throws WxErrorException { + public WxOpenResult releaseAudited() throws WxErrorException { JsonObject params = new JsonObject(); String response = post(API_RELEASE, GSON.toJson(params)); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - - /** - * 10. 修改小程序线上代码的可见状态(仅供第三方代小程序调用) - * - * @param action 设置可访问状态,发布后默认可访问,close为不可见,open为可见 - * @return - * @throws WxErrorException - */ @Override - public WxOpenResult changeVisitstatus(String action) throws WxErrorException { + public WxOpenResult changeVisitStatus(String action) throws WxErrorException { JsonObject params = new JsonObject(); params.addProperty("action", action); String response = post(API_CHANGE_VISITSTATUS, GSON.toJson(params)); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - - /** - * 11. 小程序版本回退(仅供第三方代小程序调用) - * - * @return - * @throws WxErrorException - */ @Override - public WxOpenResult revertCodeReleaes() throws WxErrorException { + public WxOpenResult revertCodeRelease() throws WxErrorException { String response = get(API_REVERT_CODE_RELEASE, null); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - - /** - * 15. 小程序审核撤回 - *

- * 单个帐号每天审核撤回次数最多不超过1次,一个月不超过10次。 - *

- * - * @return - * @throws WxErrorException - */ @Override public WxOpenResult undoCodeAudit() throws WxErrorException { String response = get(API_UNDO_CODE_AUDIT, null); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - /** - * 12. 查询当前设置的最低基础库版本及各版本用户占比 (仅供第三方代小程序调用) - * - * @return - * @throws WxErrorException - */ @Override public String getSupportVersion() throws WxErrorException { JsonObject params = new JsonObject(); - String response = post(API_GET_WEAPP_SUPPORT_VERSION, GSON.toJson(params)); - return response; + return post(API_GET_WEAPP_SUPPORT_VERSION, GSON.toJson(params)); } - - /** - * 12. 查询当前设置的最低基础库版本及各版本用户占比 (仅供第三方代小程序调用) - * - * @return - * @throws WxErrorException - */ @Override public WxOpenMaWeappSupportVersionResult getSupportVersionInfo() throws WxErrorException { String response = this.getSupportVersion(); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaWeappSupportVersionResult.class); } - /** - * 13. 设置最低基础库版本(仅供第三方代小程序调用) - * - * @param version - * @return - * @throws WxErrorException - */ @Override public String setSupportVersion(String version) throws WxErrorException { JsonObject params = new JsonObject(); params.addProperty("version", version); - String response = post(API_SET_WEAPP_SUPPORT_VERSION, GSON.toJson(params)); - return response; + return post(API_SET_WEAPP_SUPPORT_VERSION, GSON.toJson(params)); } - - /** - * 13. 设置最低基础库版本(仅供第三方代小程序调用) - * - * @param version - * @return - * @throws WxErrorException - */ @Override public WxOpenResult setSupportVersionInfo(String version) throws WxErrorException { String response = this.setSupportVersion(version); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - - /** - * 16. 小程序分阶段发布 - 1)分阶段发布接口 - * - * @param grayPercentage 灰度的百分比,1到100的整数 - * @return - * @throws WxErrorException - */ @Override - public WxOpenResult grayrelease(Integer grayPercentage) throws WxErrorException { + public WxOpenResult grayRelease(Integer grayPercentage) throws WxErrorException { JsonObject params = new JsonObject(); params.addProperty("gray_percentage", grayPercentage); String response = post(API_GRAY_RELEASE, GSON.toJson(params)); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - - /** - * 16. 小程序分阶段发布 - 2)取消分阶段发布 - * - * @return - * @throws WxErrorException - */ @Override - - public WxOpenResult revertgrayrelease() throws WxErrorException { + public WxOpenResult revertGrayRelease() throws WxErrorException { String response = get(API_REVERT_GRAY_RELEASE, null); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - - /** - * 16. 小程序分阶段发布 - 3)查询当前分阶段发布详情 - * - * @return - * @throws WxErrorException - */ @Override - public WxOpenMaGrayReleasePlanResult getgrayreleaseplan() throws WxErrorException { + public WxOpenMaGrayReleasePlanResult getGrayReleasePlan() throws WxErrorException { String response = get(API_GET_GRAY_RELEASE_PLAN, null); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaGrayReleasePlanResult.class); } - - /** - * 查询服务商的当月提审限额和加急次数(Quota) - * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/code/query_quota.html - */ @Override public WxOpenMaQueryQuotaResult queryQuota() throws WxErrorException { String response = get(API_QUERY_QUOTA, null); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaQueryQuotaResult.class); } - - /** - * 加急审核申请 - * 有加急次数的第三方可以通过该接口,对已经提审的小程序进行加急操作,加急后的小程序预计2-12小时内审完。 - */ @Override - public Boolean speedAudit(Long auditid) throws WxErrorException { + public Boolean speedAudit(Long auditId) throws WxErrorException { JsonObject params = new JsonObject(); - params.addProperty("auditid", auditid); + params.addProperty("auditid", auditId); String response = post(API_SPEED_AUDIT, GSON.toJson(params)); WxOpenResult result = WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); return result.isSuccess(); } - /** - * (1)增加或修改二维码规则 - * - * @param wxQrcodeJumpRule - * @return - * @throws WxErrorException - */ @Override public WxOpenResult addQrcodeJump(WxQrcodeJumpRule wxQrcodeJumpRule) throws WxErrorException { String response = post(API_QRCODE_JUMP_ADD, GSON.toJson(wxQrcodeJumpRule)); return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - /** - * (2)获取已设置的二维码规则 - * - * @return - * @throws WxErrorException - */ @Override public WxGetQrcodeJumpResult getQrcodeJump() throws WxErrorException { String response = post(API_QRCODE_JUMP_GET, "{}"); return WxMaGsonBuilder.create().fromJson(response, WxGetQrcodeJumpResult.class); } - /** - * (3)获取校验文件名称及内容 - * - * @return - * @throws WxErrorException - */ @Override public WxDownlooadQrcodeJumpResult downloadQrcodeJump() throws WxErrorException { String response = post(API_QRCODE_JUMP_DOWNLOAD, "{}"); return WxMaGsonBuilder.create().fromJson(response, WxDownlooadQrcodeJumpResult.class); } - /** - * (4)删除已设置的二维码规则 - * - * @param prefix - * @return - * @throws WxErrorException - */ @Override public WxOpenResult deleteQrcodeJump(String prefix) throws WxErrorException { JsonObject params = new JsonObject(); @@ -616,13 +340,6 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - /** - * (5)发布已设置的二维码规则 - * - * @param prefix - * @return - * @throws WxErrorException - */ @Override public WxOpenResult publishQrcodeJump(String prefix) throws WxErrorException { JsonObject params = new JsonObject(); @@ -631,12 +348,6 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); } - /** - * 将字符串对象转化为GsonArray对象 - * - * @param strList - * @return - */ private JsonArray toJsonArray(List strList) { JsonArray jsonArray = new JsonArray(); if (strList != null && !strList.isEmpty()) { diff --git a/weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImplTest.java b/weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImplTest.java new file mode 100644 index 000000000..0e8cba5c3 --- /dev/null +++ b/weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImplTest.java @@ -0,0 +1,162 @@ +package me.chanjar.weixin.open.api.impl; + +import org.testng.annotations.Test; + +import static org.testng.Assert.*; + +/** + * 单元测试类. + * + * @author Binary Wang + * @date 2020-06-06 + */ +public class WxOpenComponentServiceImplTest { + + @Test + public void testGetWxMpServiceByAppid() { + } + + @Test + public void testGetWxMaServiceByAppid() { + } + + @Test + public void testGetWxFastMaServiceByAppid() { + } + + @Test + public void testGetWxOpenService() { + } + + @Test + public void testGetWxOpenConfigStorage() { + } + + @Test + public void testCheckSignature() { + } + + @Test + public void testGetComponentAccessToken() { + } + + @Test + public void testPost() { + } + + @Test + public void testTestPost() { + } + + @Test + public void testGet() { + } + + @Test + public void testTestGet() { + } + + @Test + public void testGetPreAuthUrl() { + } + + @Test + public void testTestGetPreAuthUrl() { + } + + @Test + public void testGetMobilePreAuthUrl() { + } + + @Test + public void testTestGetMobilePreAuthUrl() { + } + + @Test + public void testRoute() { + } + + @Test + public void testGetQueryAuth() { + } + + @Test + public void testGetAuthorizerInfo() { + } + + @Test + public void testGetAuthorizerList() { + } + + @Test + public void testGetAuthorizerOption() { + } + + @Test + public void testSetAuthorizerOption() { + } + + @Test + public void testGetAuthorizerAccessToken() { + } + + @Test + public void testOauth2getAccessToken() { + } + + @Test + public void testTestCheckSignature() { + } + + @Test + public void testOauth2refreshAccessToken() { + } + + @Test + public void testOauth2buildAuthorizationUrl() { + } + + @Test + public void testMiniappJscode2Session() { + } + + @Test + public void testGetTemplateDraftList() { + } + + @Test + public void testGetTemplateList() { + } + + @Test + public void testAddToTemplate() { + } + + @Test + public void testDeleteTemplate() { + } + + @Test + public void testCreateOpenAccount() { + } + + @Test + public void testBindOpenAccount() { + } + + @Test + public void testUnbindOpenAccount() { + } + + @Test + public void testGetOpenAccount() { + } + + @Test + public void testFastRegisterWeapp() { + } + + @Test + public void testFastRegisterWeappSearch() { + } +} diff --git a/weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenFastMaServiceImplTest.java b/weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenFastMaServiceImplTest.java new file mode 100644 index 000000000..e5a255be1 --- /dev/null +++ b/weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenFastMaServiceImplTest.java @@ -0,0 +1,218 @@ +package me.chanjar.weixin.open.api.impl; + +import org.testng.annotations.Test; + +/** + * @author Binary Wang + * @date 2020-06-06 + */ +public class WxOpenFastMaServiceImplTest { + + @Test + public void testInitHttp() { + } + + @Test + public void testGetRequestHttpClient() { + } + + @Test + public void testGetRequestHttpProxy() { + } + + @Test + public void testGetRequestType() { + } + + @Test + public void testDoGetAccessTokenRequest() { + } + + @Test + public void testGetRequestHttp() { + } + + @Test + public void testGetPaidUnionId() { + } + + @Test + public void testJsCode2SessionInfo() { + } + + @Test + public void testSetDynamicData() { + } + + @Test + public void testCheckSignature() { + } + + @Test + public void testGetAccessToken() { + } + + @Test + public void testTestGetAccessToken() { + } + + @Test + public void testGet() { + } + + @Test + public void testPost() { + } + + @Test + public void testTestPost() { + } + + @Test + public void testExecute() { + } + + @Test + public void testExtractAccessToken() { + } + + @Test + public void testGetWxMaConfig() { + } + + @Test + public void testSetWxMaConfig() { + } + + @Test + public void testSetRetrySleepMillis() { + } + + @Test + public void testSetMaxRetryTimes() { + } + + @Test + public void testGetMsgService() { + } + + @Test + public void testGetMediaService() { + } + + @Test + public void testGetUserService() { + } + + @Test + public void testGetQrcodeService() { + } + + @Test + public void testGetTemplateService() { + } + + @Test + public void testGetSubscribeService() { + } + + @Test + public void testGetAnalysisService() { + } + + @Test + public void testGetCodeService() { + } + + @Test + public void testGetJsapiService() { + } + + @Test + public void testGetSettingService() { + } + + @Test + public void testGetShareService() { + } + + @Test + public void testGetRunService() { + } + + @Test + public void testGetSecCheckService() { + } + + @Test + public void testGetPluginService() { + } + + @Test + public void testGetExpressService() { + } + + @Test + public void testGetCloudService() { + } + + @Test + public void testGetLiveService() { + } + + @Test + public void testTestGetWxMaConfig() { + } + + @Test + public void testTestGetAccessToken1() { + } + + @Test + public void testGetAccountBasicInfo() { + } + + @Test + public void testSetNickname() { + } + + @Test + public void testQuerySetNicknameStatus() { + } + + @Test + public void testCheckWxVerifyNickname() { + } + + @Test + public void testModifyHeadImage() { + } + + @Test + public void testModifySignature() { + } + + @Test + public void testComponentRebindAdmin() { + } + + @Test + public void testGetAllCategories() { + } + + @Test + public void testAddCategory() { + } + + @Test + public void testDeleteCategory() { + } + + @Test + public void testGetCategory() { + } + + @Test + public void testModifyCategory() { + } +} diff --git a/weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImplTest.java b/weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImplTest.java new file mode 100644 index 000000000..5e5f3e668 --- /dev/null +++ b/weixin-java-open/src/test/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImplTest.java @@ -0,0 +1,334 @@ +package me.chanjar.weixin.open.api.impl; + +import org.testng.annotations.Test; + +/** + * @author Binary Wang + * @date 2020-06-06 + */ +public class WxOpenMaServiceImplTest { + + @Test + public void testInitHttp() { + } + + @Test + public void testGetRequestHttpClient() { + } + + @Test + public void testGetRequestHttpProxy() { + } + + @Test + public void testGetRequestType() { + } + + @Test + public void testDoGetAccessTokenRequest() { + } + + @Test + public void testGetRequestHttp() { + } + + @Test + public void testGetPaidUnionId() { + } + + @Test + public void testJsCode2SessionInfo() { + } + + @Test + public void testSetDynamicData() { + } + + @Test + public void testCheckSignature() { + } + + @Test + public void testGetAccessToken() { + } + + @Test + public void testTestGetAccessToken() { + } + + @Test + public void testGet() { + } + + @Test + public void testPost() { + } + + @Test + public void testTestPost() { + } + + @Test + public void testExecute() { + } + + @Test + public void testExtractAccessToken() { + } + + @Test + public void testGetWxMaConfig() { + } + + @Test + public void testSetWxMaConfig() { + } + + @Test + public void testSetRetrySleepMillis() { + } + + @Test + public void testSetMaxRetryTimes() { + } + + @Test + public void testGetMsgService() { + } + + @Test + public void testGetMediaService() { + } + + @Test + public void testGetUserService() { + } + + @Test + public void testGetQrcodeService() { + } + + @Test + public void testGetTemplateService() { + } + + @Test + public void testGetSubscribeService() { + } + + @Test + public void testGetAnalysisService() { + } + + @Test + public void testGetCodeService() { + } + + @Test + public void testGetJsapiService() { + } + + @Test + public void testGetSettingService() { + } + + @Test + public void testGetShareService() { + } + + @Test + public void testGetRunService() { + } + + @Test + public void testGetSecCheckService() { + } + + @Test + public void testGetPluginService() { + } + + @Test + public void testGetExpressService() { + } + + @Test + public void testGetCloudService() { + } + + @Test + public void testGetLiveService() { + } + + @Test + public void testTestJsCode2SessionInfo() { + } + + @Test + public void testTestGetWxMaConfig() { + } + + @Test + public void testTestGetAccessToken1() { + } + + @Test + public void testGetDomain() { + } + + @Test + public void testModifyDomain() { + } + + @Test + public void testGetWebViewDomain() { + } + + @Test + public void testGetWebViewDomainInfo() { + } + + @Test + public void testSetWebViewDomain() { + } + + @Test + public void testSetWebViewDomainInfo() { + } + + @Test + public void testGetAccountBasicInfo() { + } + + @Test + public void testBindTester() { + } + + @Test + public void testUnbindTester() { + } + + @Test + public void testUnbindTesterByUserStr() { + } + + @Test + public void testGetTesterList() { + } + + @Test + public void testChangeWxaSearchStatus() { + } + + @Test + public void testGetWxaSearchStatus() { + } + + @Test + public void testGetShowWxaItem() { + } + + @Test + public void testUpdateShowWxaItem() { + } + + @Test + public void testCodeCommit() { + } + + @Test + public void testGetTestQrcode() { + } + + @Test + public void testGetCategoryList() { + } + + @Test + public void testGetPageList() { + } + + @Test + public void testSubmitAudit() { + } + + @Test + public void testGetAuditStatus() { + } + + @Test + public void testGetLatestAuditStatus() { + } + + @Test + public void testReleaseAudited() { + } + + @Test + public void testChangeVisitStatus() { + } + + @Test + public void testRevertCodeRelease() { + } + + @Test + public void testUndoCodeAudit() { + } + + @Test + public void testGetSupportVersion() { + } + + @Test + public void testGetSupportVersionInfo() { + } + + @Test + public void testSetSupportVersion() { + } + + @Test + public void testSetSupportVersionInfo() { + } + + @Test + public void testGrayRelease() { + } + + @Test + public void testRevertGrayRelease() { + } + + @Test + public void testGetGrayReleasePlan() { + } + + @Test + public void testQueryQuota() { + } + + @Test + public void testSpeedAudit() { + } + + @Test + public void testAddQrcodeJump() { + } + + @Test + public void testGetQrcodeJump() { + } + + @Test + public void testDownloadQrcodeJump() { + } + + @Test + public void testDeleteQrcodeJump() { + } + + @Test + public void testPublishQrcodeJump() { + } +}