Add missing domain configuration APIs for mini-programs and third-party platform #3743
+200
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds all missing domain configuration APIs for WeChat mini-programs and third-party platforms as requested in issue #3739. The WeChat Open Platform provides domain configuration APIs at two levels: mini-program level and third-party platform level. This implementation completes support for all missing APIs.
APIs Added
Mini-Program Domain APIs (WxOpenMaService)
1. Fast Configure Mini-Program Server Domains (
modifyDomainDirectly)Implements the fast version of server domain configuration:
https://api.weixin.qq.com/wxa/modify_domain_directly2. Fast Configure Mini-Program Business Domains (
setWebViewDomainDirectly)Implements the fast version of business domain configuration:
https://api.weixin.qq.com/wxa/setwebviewdomain_directlysetWebViewDomainDirectly()- returns raw String responsesetWebViewDomainDirectlyInfo()- returns parsedWxOpenMaWebDomainResultobjectThird-Party Platform Domain APIs (WxOpenComponentService)
3. Configure Third-Party Platform Server Domains (
modifyWxaServerDomain)Configures server domains for the third-party platform itself:
https://api.weixin.qq.com/cgi-bin/component/modify_wxa_server_domain4. Get Third-Party Platform Domain Confirmation File (
getDomainConfirmFile)Retrieves the domain verification file for third-party platform:
https://api.weixin.qq.com/cgi-bin/component/get_domain_confirmfile5. Configure Third-Party Platform Business Domains (
modifyWxaJumpDomain)Configures business domains for the third-party platform:
https://api.weixin.qq.com/cgi-bin/component/modify_wxa_jump_domainmodifyWxaJumpDomain()- returns raw String responsemodifyWxaJumpDomainInfo()- returns parsedWxOpenMaWebDomainResultobjectNote on Existing API
The API
get_webviewdomain_confirmfilefor mini-programs was already implemented asgetWebviewDomainConfirmFile()in the codebase, so no additional implementation was needed for it.Implementation Details
Testing
Note: Integration tests require valid WeChat Open Platform credentials and are disabled by default.
Files Changed
weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java- Added mini-program interface methods and API constantsweixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java- Added mini-program implementationsweixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenComponentService.java- Added third-party platform interface methods and API constantsweixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImpl.java- Added third-party platform implementationsTotal: 200 lines added across 4 files
Fixes #3739
Original prompt
Fixes #3739
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.