Skip to main content

wx_rust_open/api/
wx_open_component_service.rs

1//! 开放平台组件服务。
2//!
3//! 对应 Java `me.chanjar.weixin.open.api.WxOpenComponentService`(1184 行、
4//! 100+ 方法)。Wave 0 冻结与「component 预授权码 / component_access_token /
5//! 三方 token 刷新 / POST 回调消息解密」相关的核心签名(B0 签名冻结);
6//! Wave 2 补齐其余全部方法签名(授权方信息/选项/列表、代码模板、open
7//! 帐号、快速创建、minishop、tcb、oauth2、服务器域名等),默认实现返回
8//! `Err(-99)`(待定清单见各方法文档与 `impl` 覆写),核心方法由
9//! [`crate::api::impl::WxOpenComponentServiceImpl`] 覆写。
10//!
11//! 镜像说明:
12//! - Java `void` → `Result<(), WxErrorException>`;Java `boolean` →
13//!   `bool`;`Integer`/`Long` → `i32`/`i64`(可空取 `Option`);
14//!   `List<T>` → `Vec<T>`(Java 可返回 null 处取 `Option<Vec<T>>`)。
15//! - Java `String` 可返回 null(如 `minishopGetCouponList`/`minishopCommonPost`
16//!   的 `return null`)→ `Option<String>`/`Option<T>` 镜像同一语义。
17//! - Java `File` 入参 → `&str` 文件路径(ADAPTED)。
18//! - Java `WxMaJscode2SessionResult`(wx-rust-miniapp 的 bean)→
19//!   `serde_json::Value`(ADAPTED,Wave 2 引入 miniapp 依赖后换型)。
20//! - Java `WxOpenMpService`/`WxOpenMaService`/`WxOpenFastMaService`/
21//!   `WxOpenMinishopService`(代 mp/ma 桥接子服务)→
22//!   `Option<Arc<dyn Any + Send + Sync>>`(ADAPTED,待依赖接线,当前恒
23//!   返回 `None`;接线后调用方 `downcast_arc` 取具体服务,签名不变)。
24//! - Java `getWxOpenConfigStorage()` → [`Self::wx_open_config_storage`]
25//!   (可推导的真实默认实现,不占位)。
26
27use std::any::Any;
28use std::sync::Arc;
29
30use async_trait::async_trait;
31
32use wx_rust_common::bean::oauth2::WxOAuth2AccessToken;
33use wx_rust_common::bean::result::WxMinishopImageUploadResult;
34use wx_rust_common::error::WxErrorException;
35
36use crate::api::WxOpenService;
37use crate::bean::message::WxOpenXmlMessage;
38use crate::bean::{
39    GetShareCloudBaseEnvResponse, GetTcbEnvListResponse, LimitDiscountGoods, MinishopBrandList,
40    MinishopBusiLicense, MinishopCategories, MinishopDeliveryTemplateResult, MinishopIdcardInfo,
41    MinishopNameInfo, MinishopOrganizationCodeInfo, MinishopReturnInfo, MinishopShopCatList,
42    MinishopSuperAdministratorInfo, ShareCloudBaseEnvRequest, ShareCloudBaseEnvResponse,
43    WxMinishopAddGoodsSpuResult, WxMinishopCoupon, WxMinishopCouponStock, WxMinishopSku,
44    WxMinishopSpu, WxOpenAuthorizerInfoResult, WxOpenAuthorizerListResult,
45    WxOpenAuthorizerOptionResult, WxOpenCreateResult, WxOpenGetResult, WxOpenHaveResult,
46    WxOpenMaApplyOrderPathInfo, WxOpenMaCodeTemplate, WxOpenMaDomainConfirmFileResult,
47    WxOpenMaDomainResult, WxOpenMaWebDomainResult, WxOpenQueryAuthResult,
48    WxOpenRegisterBetaWeappResult, WxOpenRegisterPersonalWeappResult, WxOpenResult,
49};
50use crate::config::WxOpenConfigStorage;
51
52/// 开放平台组件服务(第三方平台核心子服务)。
53#[async_trait]
54pub trait WxOpenComponentService: Send + Sync {
55    /// 持有的门面服务(对应 Java `getWxOpenService()`)。
56    ///
57    /// Rust 以弱引用打破循环(Java `new WxOpenComponentServiceImpl(this)`),
58    /// 升级失败(门面已释放)时返回 `None`。
59    fn wx_open_service(&self) -> Option<Arc<dyn WxOpenService>>;
60
61    /// 校验消息签名(对应 Java `checkSignature(String, String, String)`)。
62    ///
63    /// SHA1(componentToken + timestamp + nonce 排序后无分隔符拼接)与
64    /// signature 比较;验签失败或门面缺失时返回 false。
65    fn check_signature(&self, timestamp: &str, nonce: &str, signature: &str) -> bool {
66        use wx_rust_common::util::crypto::Sha1;
67        match self.wx_open_service() {
68            Some(svc) => {
69                let config = svc.wx_open_config_storage();
70                let token = config.component_token().unwrap_or_default();
71                match Sha1::digest(&[token.as_str(), timestamp, nonce]) {
72                    Ok(s) => s == signature,
73                    Err(_) => false,
74                }
75            }
76            None => false,
77        }
78    }
79
80    /// 启动 verify ticket 推送服务(对应 Java `startPushTicket()`)。
81    async fn start_push_ticket(&self) -> Result<(), WxErrorException> {
82        Err(WxErrorException::from_code(
83            -99,
84            "start_push_ticket 未实现(Wave 2)",
85        ))
86    }
87
88    /// 获取 component_access_token(对应 Java
89    /// `getComponentAccessToken(boolean forceRefresh)`,开放平台接口调用凭据)。
90    ///
91    /// 双检锁缓存:未过期直接返回;否则持锁以
92    /// component_appid/component_appsecret/component_verify_ticket 调
93    /// `api_component_token` 刷新。
94    async fn get_component_access_token(
95        &self,
96        _force_refresh: bool,
97    ) -> Result<String, WxErrorException> {
98        Err(WxErrorException::from_code(
99            -99,
100            "get_component_access_token 未实现(Wave 2)",
101        ))
102    }
103
104    /// POST 请求(对应 Java `post(String, String)`,默认注入键
105    /// `component_access_token`)。
106    async fn post(&self, _uri: &str, _post_data: &str) -> Result<String, WxErrorException> {
107        Err(WxErrorException::from_code(-99, "post 未实现(Wave 2)"))
108    }
109
110    /// POST 请求(对应 Java `post(String, String, String accessTokenKey)`,
111    /// 自定义 token 注入键)。
112    async fn post_with_key(
113        &self,
114        _uri: &str,
115        _post_data: &str,
116        _access_token_key: &str,
117    ) -> Result<String, WxErrorException> {
118        Err(WxErrorException::from_code(
119            -99,
120            "post_with_key 未实现(Wave 2)",
121        ))
122    }
123
124    /// POST 请求(对应 Java `post(String, String, String accessTokenKey,
125    /// String accessToken)`,调用方显式传 token,不做自动刷新)。
126    async fn post_with_token(
127        &self,
128        _uri: &str,
129        _post_data: &str,
130        _access_token_key: &str,
131        _access_token: &str,
132    ) -> Result<String, WxErrorException> {
133        Err(WxErrorException::from_code(
134            -99,
135            "post_with_token 未实现(Wave 2)",
136        ))
137    }
138
139    /// GET 请求(对应 Java `get(String uri)`,默认注入键
140    /// `component_access_token`)。
141    async fn get(&self, _uri: &str) -> Result<String, WxErrorException> {
142        Err(WxErrorException::from_code(-99, "get 未实现(Wave 2)"))
143    }
144
145    /// GET 请求(对应 Java `get(String uri, String accessTokenKey)`)。
146    async fn get_with_key(
147        &self,
148        _uri: &str,
149        _access_token_key: &str,
150    ) -> Result<String, WxErrorException> {
151        Err(WxErrorException::from_code(
152            -99,
153            "get_with_key 未实现(Wave 2)",
154        ))
155    }
156
157    /// 获取预授权码(对应 Java `WxOpenComponentServiceImpl.createPreAuthUrl`
158    /// 内部 POST `API_CREATE_PREAUTHCODE_URL` 的 `pre_auth_code` 字段)。
159    async fn get_pre_auth_code(&self) -> Result<String, WxErrorException> {
160        Err(WxErrorException::from_code(
161            -99,
162            "get_pre_auth_code 未实现(Wave 2)",
163        ))
164    }
165
166    /// 获取网页授权预授权链接(对应 Java `getPreAuthUrl(String redirectUri)`)。
167    async fn get_pre_auth_url(&self, _redirect_uri: &str) -> Result<String, WxErrorException> {
168        Err(WxErrorException::from_code(
169            -99,
170            "get_pre_auth_url 未实现(Wave 2)",
171        ))
172    }
173
174    /// 获取网页授权预授权链接(对应 Java
175    /// `getPreAuthUrl(String redirectUri, String authType, String bizAppid)`)。
176    async fn get_pre_auth_url_with(
177        &self,
178        _redirect_uri: &str,
179        _auth_type: Option<&str>,
180        _biz_appid: Option<&str>,
181    ) -> Result<String, WxErrorException> {
182        Err(WxErrorException::from_code(
183            -99,
184            "get_pre_auth_url_with 未实现(Wave 2)",
185        ))
186    }
187
188    /// 获取移动端预授权链接(对应 Java `getMobilePreAuthUrl(String redirectUri)`)。
189    async fn get_mobile_pre_auth_url(
190        &self,
191        _redirect_uri: &str,
192    ) -> Result<String, WxErrorException> {
193        Err(WxErrorException::from_code(
194            -99,
195            "get_mobile_pre_auth_url 未实现(Wave 2)",
196        ))
197    }
198
199    /// 获取移动端预授权链接(对应 Java
200    /// `getMobilePreAuthUrl(String redirectUri, String authType, String bizAppid)`)。
201    async fn get_mobile_pre_auth_url_with(
202        &self,
203        _redirect_uri: &str,
204        _auth_type: Option<&str>,
205        _biz_appid: Option<&str>,
206    ) -> Result<String, WxErrorException> {
207        Err(WxErrorException::from_code(
208            -99,
209            "get_mobile_pre_auth_url_with 未实现(Wave 2)",
210        ))
211    }
212
213    /// 获取(刷新)授权方 access_token(对应 Java
214    /// `getAuthorizerAccessToken(String appid, boolean forceRefresh)`,
215    /// 三方 token 刷新链:refresh_token 换新 token)。
216    async fn get_authorizer_access_token(
217        &self,
218        _app_id: &str,
219        _force_refresh: bool,
220    ) -> Result<String, WxErrorException> {
221        Err(WxErrorException::from_code(
222            -99,
223            "get_authorizer_access_token 未实现(Wave 2)",
224        ))
225    }
226
227    /// 路由第三方平台推送的加密回调消息(对应 Java
228    /// `route(WxOpenXmlMessage wxMessage)`,POST 回调消息解密 + 分发)。
229    ///
230    /// 入参为解密后的 [`WxOpenXmlMessage`](解密经
231    /// `WxOpenXmlMessage::from_encrypted_xml` 完成,对应 Java 调用方先用
232    /// `fromEncryptedXml` 解密再 `route` 的流程);Wave 2 实现。
233    async fn route(&self, _message: &WxOpenXmlMessage) -> Result<String, WxErrorException> {
234        Err(WxErrorException::from_code(-99, "route 未实现(Wave 2)"))
235    }
236
237    // ---- 配置与子服务(对应 Java WxOpenComponentService 同名列) ----
238
239    /// 配置存储(对应 Java `getWxOpenConfigStorage()`,委托门面)。
240    ///
241    /// 门面已释放时返回 `None`(Java 强引用不可能为空,ADAPTED)。
242    fn wx_open_config_storage(&self) -> Option<Arc<dyn WxOpenConfigStorage>> {
243        self.wx_open_service()
244            .map(|svc| svc.wx_open_config_storage())
245    }
246
247    /// 获取指定 appid 的开放平台公众号服务(对应 Java
248    /// `getWxMpServiceByAppid(String appid)`,双检锁缓存按 appid 装配
249    /// `WxOpenMpServiceImpl`)。
250    ///
251    /// ADAPTED(待依赖接线):wx-rust-open 尚未依赖 wx-rust-mp,恒返回
252    /// `None`;Wave 2+ 接线方案:Cargo.toml 引入 wx-rust-mp 后以
253    /// `Arc<dyn WxMpService>` 装配 `WxOpenMpService`,调用方
254    /// `downcast_arc::<dyn WxMpService>()` 取服务,本签名不变。
255    fn get_wx_mp_service_by_appid(&self, _app_id: &str) -> Option<Arc<dyn Any + Send + Sync>> {
256        None
257    }
258
259    /// 获取指定 appid 的开放平台小程序服务(对应 Java
260    /// `getWxMaServiceByAppid(String appid)`,继承一般小程序服务能力)。
261    ///
262    /// 接线说明同 [`Self::get_wx_mp_service_by_appid`](待依赖接线,
263    /// 恒返回 `None`)。
264    fn get_wx_ma_service_by_appid(&self, _app_id: &str) -> Option<Arc<dyn Any + Send + Sync>> {
265        None
266    }
267
268    /// 获取指定 appid 的快速创建的小程序服务(对应 Java
269    /// `getWxFastMaServiceByAppid(String appid)`)。
270    ///
271    /// Java `@Deprecated`(2021-06-23:本接口原有方法并非仅快速创建小程序的
272    /// 专用接口,请使用 `WxOpenMaService.getBasicService()`)。接线说明同
273    /// [`Self::get_wx_mp_service_by_appid`](恒返回 `None`)。
274    fn get_wx_fast_ma_service_by_appid(&self, _app_id: &str) -> Option<Arc<dyn Any + Send + Sync>> {
275        None
276    }
277
278    /// 获取指定 appid 的小商店服务(对应 Java
279    /// `getWxMinishopServiceByAppid(String appid)`)。
280    ///
281    /// Wave 5 已接线:实现侧按 appid 双检锁缓存装配
282    /// [`crate::api::r#impl::WxOpenMinishopServiceImpl`](镜像 Java 静态
283    /// `WX_OPEN_MINISHOP_SERVICE_MAP`);返回值经 downcast 下转(本 trait
284    /// 默认实现仍为 `None`,由组件实现覆写)。
285    fn get_wx_minishop_service_by_appid(
286        &self,
287        _app_id: &str,
288    ) -> Option<Arc<dyn Any + Send + Sync>> {
289        None
290    }
291
292    // ---- 授权方信息/选项/列表(对应 Java 同名方法) ----
293
294    /// 使用授权码换取公众号或小程序的接口调用凭据和授权信息(对应 Java
295    /// `getQueryAuth(String authorizationCode)`)。
296    ///
297    /// 成功后回写授权方 access_token/refresh_token 到配置存储
298    /// (`updateAuthorizerAccessToken`/`updateAuthorizerRefreshToken`)。
299    async fn get_query_auth(
300        &self,
301        _authorization_code: &str,
302    ) -> Result<WxOpenQueryAuthResult, WxErrorException> {
303        Err(WxErrorException::from_code(
304            -99,
305            "get_query_auth 未实现(Wave 2)",
306        ))
307    }
308
309    /// 获取授权方的帐号基本信息(对应 Java
310    /// `getAuthorizerInfo(String authorizerAppid)`)。
311    async fn get_authorizer_info(
312        &self,
313        _authorizer_appid: &str,
314    ) -> Result<WxOpenAuthorizerInfoResult, WxErrorException> {
315        Err(WxErrorException::from_code(
316            -99,
317            "get_authorizer_info 未实现(Wave 2)",
318        ))
319    }
320
321    /// 获取所有授权方列表(对应 Java
322    /// `getAuthorizerList(int begin, int len)`)。
323    ///
324    /// 成功后将列表中的 authorizer_appid/refresh_token 回写配置存储。
325    async fn get_authorizer_list(
326        &self,
327        _begin: i32,
328        _len: i32,
329    ) -> Result<WxOpenAuthorizerListResult, WxErrorException> {
330        Err(WxErrorException::from_code(
331            -99,
332            "get_authorizer_list 未实现(Wave 2)",
333        ))
334    }
335
336    /// 获取授权方的选项设置信息(对应 Java
337    /// `getAuthorizerOption(String authorizerAppid, String optionName)`,
338    /// 以授权方 access_token 为 key 调用)。
339    async fn get_authorizer_option(
340        &self,
341        _authorizer_appid: &str,
342        _option_name: &str,
343    ) -> Result<WxOpenAuthorizerOptionResult, WxErrorException> {
344        Err(WxErrorException::from_code(
345            -99,
346            "get_authorizer_option 未实现(Wave 2)",
347        ))
348    }
349
350    /// 设置授权方的选项信息(对应 Java
351    /// `setAuthorizerOption(String authorizerAppid, String optionName,
352    /// String optionValue)`)。
353    async fn set_authorizer_option(
354        &self,
355        _authorizer_appid: &str,
356        _option_name: &str,
357        _option_value: &str,
358    ) -> Result<(), WxErrorException> {
359        Err(WxErrorException::from_code(
360            -99,
361            "set_authorizer_option 未实现(Wave 2)",
362        ))
363    }
364
365    /// 校验消息签名(对应 Java `checkSignature(String appid, String timestamp,
366    /// String nonce, String signature)`)。
367    ///
368    /// Java 实现恒返回 false(appid 维度签名未实现),原样镜像。
369    fn check_signature_with_appid(
370        &self,
371        _app_id: &str,
372        _timestamp: &str,
373        _nonce: &str,
374        _signature: &str,
375    ) -> bool {
376        false
377    }
378
379    // ---- oauth2 与小程序登录(对应 Java 同名方法) ----
380
381    /// 用 code 换取 oauth2 的 access token(对应 Java `oauth2getAccessToken
382    /// (String appid, String code)`)。
383    ///
384    /// Java `@Deprecated`(2021-05-21:请使用
385    /// `getWxMpServiceByAppid(mpAppId).getOAuth2Service().getAccessToken(code)`)。
386    async fn oauth2_get_access_token(
387        &self,
388        _app_id: &str,
389        _code: &str,
390    ) -> Result<WxOAuth2AccessToken, WxErrorException> {
391        Err(WxErrorException::from_code(
392            -99,
393            "oauth2_get_access_token 未实现(Wave 2)",
394        ))
395    }
396
397    /// 刷新 oauth2 的 access token(对应 Java
398    /// `oauth2refreshAccessToken(String appid, String refreshToken)`)。
399    async fn oauth2_refresh_access_token(
400        &self,
401        _app_id: &str,
402        _refresh_token: &str,
403    ) -> Result<WxOAuth2AccessToken, WxErrorException> {
404        Err(WxErrorException::from_code(
405            -99,
406            "oauth2_refresh_access_token 未实现(Wave 2)",
407        ))
408    }
409
410    /// 构建 oauth2 授权链接(对应 Java `oauth2buildAuthorizationUrl(String
411    /// appid, String redirectUri, String scope, String state)`)。
412    ///
413    /// Java `@Deprecated`(2021-05-21,见 [`Self::oauth2_get_access_token`])。
414    /// 纯字符串构建(redirect_uri 经 encodeURIComponent 语义编码),不抛错。
415    fn oauth2_build_authorization_url(
416        &self,
417        app_id: &str,
418        redirect_uri: &str,
419        scope: &str,
420        state: &str,
421    ) -> String {
422        use percent_encoding::{NON_ALPHANUMERIC, utf8_percent_encode};
423        let component_app_id = self
424            .wx_open_config_storage()
425            .and_then(|c| c.component_app_id())
426            .unwrap_or_default();
427        let encoded_redirect = utf8_percent_encode(redirect_uri, NON_ALPHANUMERIC).to_string();
428        format!(
429            "https://open.weixin.qq.com/connect/oauth2/authorize?appid={}&redirect_uri={}&response_type=code&scope={}&state={}&component_appid={}#wechat_redirect",
430            app_id,
431            encoded_redirect,
432            scope,
433            state.trim(),
434            component_app_id
435        )
436    }
437
438    /// 小程序登录 code 换 session(对应 Java
439    /// `miniappJscode2Session(String appId, String jsCode)`)。
440    ///
441    /// ADAPTED:Java 返回 `WxMaJscode2SessionResult`(wx-rust-miniapp 的
442    /// bean,open 模块暂不依赖),Rust 返回解析后的
443    /// `serde_json::Value`,接线后换型。
444    async fn miniapp_jscode2_session(
445        &self,
446        _app_id: &str,
447        _js_code: &str,
448    ) -> Result<serde_json::Value, WxErrorException> {
449        Err(WxErrorException::from_code(
450            -99,
451            "miniapp_jscode2_session 未实现(Wave 2)",
452        ))
453    }
454
455    // ---- 小程序代码模板(对应 Java 同名方法,access_token 注入键为
456    // "access_token"(component_access_token),非默认键) ----
457
458    /// 获取草稿箱内的所有临时代码草稿(对应 Java `getTemplateDraftList()`)。
459    ///
460    /// Java 无 `draft_list` 字段时返回 null → `Ok(None)` 镜像。
461    async fn get_template_draft_list(
462        &self,
463    ) -> Result<Option<Vec<WxOpenMaCodeTemplate>>, WxErrorException> {
464        Err(WxErrorException::from_code(
465            -99,
466            "get_template_draft_list 未实现(Wave 2)",
467        ))
468    }
469
470    /// 获取代码模版库中的所有小程序代码模版(对应 Java `getTemplateList()`,
471    /// Java `@Deprecated`,请使用 [`Self::get_template_list_with_type`])。
472    async fn get_template_list(
473        &self,
474    ) -> Result<Option<Vec<WxOpenMaCodeTemplate>>, WxErrorException> {
475        Err(WxErrorException::from_code(
476            -99,
477            "get_template_list 未实现(Wave 2)",
478        ))
479    }
480
481    /// 获取代码模版库中的所有小程序代码模版(对应 Java
482    /// `getTemplateList(Integer templateType)`;`template_type` 可空,
483    /// 默认全部,0 普通模板,1 标准模板)。
484    async fn get_template_list_with_type(
485        &self,
486        _template_type: Option<i32>,
487    ) -> Result<Option<Vec<WxOpenMaCodeTemplate>>, WxErrorException> {
488        Err(WxErrorException::from_code(
489            -99,
490            "get_template_list_with_type 未实现(Wave 2)",
491        ))
492    }
493
494    /// 将草稿箱的草稿选为小程序代码模版(对应 Java `addToTemplate(long
495    /// draftId)`,Java `@Deprecated`,请使用
496    /// [`Self::add_to_template_with_type`])。
497    async fn add_to_template(&self, _draft_id: i64) -> Result<(), WxErrorException> {
498        Err(WxErrorException::from_code(
499            -99,
500            "add_to_template 未实现(Wave 2)",
501        ))
502    }
503
504    /// 将草稿添加到代码模板库(对应 Java `addToTemplate(long draftId,
505    /// int templateType)`;`template_type`:普通模板 0,标准模板 1)。
506    async fn add_to_template_with_type(
507        &self,
508        _draft_id: i64,
509        _template_type: i32,
510    ) -> Result<(), WxErrorException> {
511        Err(WxErrorException::from_code(
512            -99,
513            "add_to_template_with_type 未实现(Wave 2)",
514        ))
515    }
516
517    /// 删除指定小程序代码模版(对应 Java `deleteTemplate(long templateId)`)。
518    async fn delete_template(&self, _template_id: i64) -> Result<(), WxErrorException> {
519        Err(WxErrorException::from_code(
520            -99,
521            "delete_template 未实现(Wave 2)",
522        ))
523    }
524
525    // ---- open 帐号管理(对应 Java 同名方法) ----
526
527    /// 创建开放平台帐号并绑定公众号/小程序(对应 Java
528    /// `createOpenAccount(String appId, String appIdType)`;
529    /// `app_id_type`:mp-公众号 / mini-小程序)。
530    ///
531    /// 待接线:Java 经 `openAccountServicePost` 走代 mp/ma 子服务的 post
532    /// (`getWxMpServiceByAppid`/`getWxMaServiceByAppid`),Rust 侧子服务
533    /// 桥接尚未接线(恒 None)→ 返回未实现错误。
534    async fn create_open_account(
535        &self,
536        _app_id: &str,
537        _app_id_type: &str,
538    ) -> Result<WxOpenCreateResult, WxErrorException> {
539        Err(WxErrorException::from_code(
540            -99,
541            "create_open_account 未实现(Wave 2,待代 mp/ma 接线)",
542        ))
543    }
544
545    /// 将公众号/小程序绑定到开放平台帐号下(对应 Java
546    /// `bindOpenAccount(String appId, String appIdType, String openAppid)`)。
547    ///
548    /// 接线说明同 [`Self::create_open_account`]。
549    async fn bind_open_account(
550        &self,
551        _app_id: &str,
552        _app_id_type: &str,
553        _open_appid: &str,
554    ) -> Result<bool, WxErrorException> {
555        Err(WxErrorException::from_code(
556            -99,
557            "bind_open_account 未实现(Wave 2,待代 mp/ma 接线)",
558        ))
559    }
560
561    /// 将公众号/小程序从开放平台帐号下解绑(对应 Java
562    /// `unbindOpenAccount(String appId, String appIdType, String openAppid)`)。
563    ///
564    /// 接线说明同 [`Self::create_open_account`]。
565    async fn unbind_open_account(
566        &self,
567        _app_id: &str,
568        _app_id_type: &str,
569        _open_appid: &str,
570    ) -> Result<bool, WxErrorException> {
571        Err(WxErrorException::from_code(
572            -99,
573            "unbind_open_account 未实现(Wave 2,待代 mp/ma 接线)",
574        ))
575    }
576
577    /// 获取公众号/小程序所绑定的开放平台帐号(对应 Java
578    /// `getOpenAccount(String appId, String appIdType)`)。
579    ///
580    /// 接线说明同 [`Self::create_open_account`]。
581    async fn get_open_account(
582        &self,
583        _app_id: &str,
584        _app_id_type: &str,
585    ) -> Result<WxOpenGetResult, WxErrorException> {
586        Err(WxErrorException::from_code(
587            -99,
588            "get_open_account 未实现(Wave 2,待代 mp/ma 接线)",
589        ))
590    }
591
592    /// 查询公众号/小程序是否绑定 open 帐号(对应 Java `haveOpen()`,
593    /// 走 component_access_token,注入键 "access_token")。
594    async fn have_open(&self) -> Result<WxOpenHaveResult, WxErrorException> {
595        Err(WxErrorException::from_code(
596            -99,
597            "have_open 未实现(Wave 2)",
598        ))
599    }
600
601    // ---- 快速创建小程序(对应 Java 同名方法) ----
602
603    /// 第三方平台快速创建小程序(对应 Java `fastRegisterWeapp(String name,
604    /// String code, String codeType, String legalPersonaWechat, String
605    /// legalPersonaName, String componentPhone)`)。
606    async fn fast_register_weapp(
607        &self,
608        _name: &str,
609        _code: &str,
610        _code_type: &str,
611        _legal_persona_wechat: &str,
612        _legal_persona_name: &str,
613        _component_phone: &str,
614    ) -> Result<WxOpenResult, WxErrorException> {
615        Err(WxErrorException::from_code(
616            -99,
617            "fast_register_weapp 未实现(Wave 2)",
618        ))
619    }
620
621    /// 查询第三方平台快速创建小程序的任务状态(对应 Java
622    /// `fastRegisterWeappSearch(String name, String legalPersonaWechat,
623    /// String legalPersonaName)`)。
624    async fn fast_register_weapp_search(
625        &self,
626        _name: &str,
627        _legal_persona_wechat: &str,
628        _legal_persona_name: &str,
629    ) -> Result<WxOpenResult, WxErrorException> {
630        Err(WxErrorException::from_code(
631            -99,
632            "fast_register_weapp_search 未实现(Wave 2)",
633        ))
634    }
635
636    /// 快速创建个人小程序(对应 Java `fastRegisterPersonalWeapp(String
637    /// idname, String wxuser, String componentPhone)`)。
638    async fn fast_register_personal_weapp(
639        &self,
640        _idname: &str,
641        _wxuser: &str,
642        _component_phone: &str,
643    ) -> Result<WxOpenRegisterPersonalWeappResult, WxErrorException> {
644        Err(WxErrorException::from_code(
645            -99,
646            "fast_register_personal_weapp 未实现(Wave 2)",
647        ))
648    }
649
650    /// 查询个人小程序注册任务状态(对应 Java
651    /// `fastRegisterPersonalWeappSearch(String taskid)`)。
652    async fn fast_register_personal_weapp_search(
653        &self,
654        _taskid: &str,
655    ) -> Result<WxOpenRegisterPersonalWeappResult, WxErrorException> {
656        Err(WxErrorException::from_code(
657            -99,
658            "fast_register_personal_weapp_search 未实现(Wave 2)",
659        ))
660    }
661
662    /// 注册试用小程序(对应 Java `fastRegisterBetaWeapp(String name,
663    /// String openid)`;注入键 "access_token")。
664    async fn fast_register_beta_weapp(
665        &self,
666        _name: &str,
667        _openid: &str,
668    ) -> Result<WxOpenRegisterBetaWeappResult, WxErrorException> {
669        Err(WxErrorException::from_code(
670            -99,
671            "fast_register_beta_weapp 未实现(Wave 2)",
672        ))
673    }
674
675    // ---- minishop 小商店(对应 Java 同名方法) ----
676
677    /// 注册小商店账号(对应 Java `registerShop(String wxName, String
678    /// idCardName, String idCardNumber, String channelId, Integer
679    /// apiOpenstoreType, String authPageUrl)`)。
680    async fn register_shop(
681        &self,
682        _wx_name: &str,
683        _id_card_name: &str,
684        _id_card_number: &str,
685        _channel_id: Option<&str>,
686        _api_openstore_type: Option<i32>,
687        _auth_page_url: Option<&str>,
688    ) -> Result<WxOpenResult, WxErrorException> {
689        Err(WxErrorException::from_code(
690            -99,
691            "register_shop 未实现(Wave 2)",
692        ))
693    }
694
695    /// 异步状态查询(对应 Java `checkAuditStatus(String wxName)`,
696    /// component_access_token 查询小商店注册状态)。
697    async fn check_audit_status(&self, _wx_name: &str) -> Result<String, WxErrorException> {
698        Err(WxErrorException::from_code(
699            -99,
700            "check_audit_status 未实现(Wave 2)",
701        ))
702    }
703
704    /// 已获取小商店 appId 后以授权方 access_token 查询状态(对应 Java
705    /// `checkAuditStatus(String appId, String wxName)`)。
706    async fn check_audit_status_with_appid(
707        &self,
708        _app_id: &str,
709        _wx_name: &str,
710    ) -> Result<String, WxErrorException> {
711        Err(WxErrorException::from_code(
712            -99,
713            "check_audit_status_with_appid 未实现(Wave 2)",
714        ))
715    }
716
717    /// 提交小商店商户信息(对应 Java `submitMerchantInfo(String appId,
718    /// String subjectType, MinishopBusiLicense busiLicense,
719    /// MinishopOrganizationCodeInfo organizationCodeInfo,
720    /// MinishopIdcardInfo idcardInfo, MinishopSuperAdministratorInfo
721    /// superAdministratorInfo, String merchantShoprtName)`,授权方
722    /// access_token)。
723    async fn submit_merchant_info(
724        &self,
725        _app_id: &str,
726        _subject_type: &str,
727        _busi_license: &MinishopBusiLicense,
728        _organization_code_info: Option<&MinishopOrganizationCodeInfo>,
729        _idcard_info: Option<&MinishopIdcardInfo>,
730        _super_administrator_info: Option<&MinishopSuperAdministratorInfo>,
731        _merchant_shortname: Option<&str>,
732    ) -> Result<WxOpenResult, WxErrorException> {
733        Err(WxErrorException::from_code(
734            -99,
735            "submit_merchant_info 未实现(Wave 2)",
736        ))
737    }
738
739    /// 提交小商店基础信息(对应 Java `submitBasicInfo(String appId,
740    /// MinishopNameInfo nameInfo, MinishopReturnInfo returnInfo)`,
741    /// 授权方 access_token)。
742    async fn submit_basic_info(
743        &self,
744        _app_id: &str,
745        _name_info: &MinishopNameInfo,
746        _return_info: &MinishopReturnInfo,
747    ) -> Result<WxOpenResult, WxErrorException> {
748        Err(WxErrorException::from_code(
749            -99,
750            "submit_basic_info 未实现(Wave 2)",
751        ))
752    }
753
754    /// 上传小商店图片素材(对应 Java `uploadMinishopImagePicFile(String
755    /// appId, Integer height, Integer width, File file)`)。
756    ///
757    /// ADAPTED:Java `File` 入参 → Rust 文件路径 `&str`;实际 multipart
758    /// 上传经门面 [`crate::api::WxOpenService::upload_minishop_media_file`]
759    /// (MinishopUploadRequestExecutor)。
760    async fn upload_minishop_image_pic_file(
761        &self,
762        _app_id: &str,
763        _height: i32,
764        _width: i32,
765        _file_path: &str,
766    ) -> Result<WxMinishopImageUploadResult, WxErrorException> {
767        Err(WxErrorException::from_code(
768            -99,
769            "upload_minishop_image_pic_file 未实现(Wave 2)",
770        ))
771    }
772
773    /// 获取小商店的类目详情(对应 Java `getMinishopCategories(String appId,
774    /// Integer fCatId)`,`f_cat_id` 可先填 0 获取根部类目)。
775    async fn get_minishop_categories(
776        &self,
777        _app_id: &str,
778        _f_cat_id: i32,
779    ) -> Result<MinishopCategories, WxErrorException> {
780        Err(WxErrorException::from_code(
781            -99,
782            "get_minishop_categories 未实现(Wave 2)",
783        ))
784    }
785
786    /// 获取小商店品牌信息(对应 Java `getMinishopBrands(String appId)`)。
787    async fn get_minishop_brands(
788        &self,
789        _app_id: &str,
790    ) -> Result<MinishopBrandList, WxErrorException> {
791        Err(WxErrorException::from_code(
792            -99,
793            "get_minishop_brands 未实现(Wave 2)",
794        ))
795    }
796
797    /// 获取小商店运费模版信息(对应 Java
798    /// `getMinishopDeliveryTemplate(String appId)`)。
799    async fn get_minishop_delivery_template(
800        &self,
801        _app_id: &str,
802    ) -> Result<MinishopDeliveryTemplateResult, WxErrorException> {
803        Err(WxErrorException::from_code(
804            -99,
805            "get_minishop_delivery_template 未实现(Wave 2)",
806        ))
807    }
808
809    /// 获取小商店商品分类信息(对应 Java `getMinishopCatList(String appId)`)。
810    async fn get_minishop_cat_list(
811        &self,
812        _app_id: &str,
813    ) -> Result<MinishopShopCatList, WxErrorException> {
814        Err(WxErrorException::from_code(
815            -99,
816            "get_minishop_cat_list 未实现(Wave 2)",
817        ))
818    }
819
820    /// 获取小商店的快递公司列表(对应 Java
821    /// `getMinishopDeliveryCompany(String appId)`,返回
822    /// `WxMinishopAddGoodsSpuResult<List<WxMinishopDeliveryCompany>>`;
823    /// Rust 侧 `WxMinishopAddGoodsSpuResult.data` 为 `serde_json::Value`
824    /// 承载 company_list 数组,ADAPTED)。
825    async fn get_minishop_delivery_company(
826        &self,
827        _app_id: &str,
828    ) -> Result<WxMinishopAddGoodsSpuResult, WxErrorException> {
829        Err(WxErrorException::from_code(
830            -99,
831            "get_minishop_delivery_company 未实现(Wave 2)",
832        ))
833    }
834
835    /// 创建小商店优惠券(对应 Java `minishopCreateCoupon(String appId,
836    /// WxMinishopCoupon couponInfo)`,返回 couponId)。
837    async fn minishop_create_coupon(
838        &self,
839        _app_id: &str,
840        _coupon_info: &WxMinishopCoupon,
841    ) -> Result<i32, WxErrorException> {
842        Err(WxErrorException::from_code(
843            -99,
844            "minishop_create_coupon 未实现(Wave 2)",
845        ))
846    }
847
848    /// 获取小商店的优惠券信息(对应 Java `minishopGetCouponList(String
849    /// appId, String startCreateTime, String endCreateTime, Integer status,
850    /// Integer page, Integer pageSize)`)。
851    ///
852    /// Java 实现恒 `return null` → `Ok(None)` 镜像。
853    async fn minishop_get_coupon_list(
854        &self,
855        _app_id: &str,
856        _start_create_time: &str,
857        _end_create_time: &str,
858        _status: i32,
859        _page: i32,
860        _page_size: i32,
861    ) -> Result<Option<WxMinishopCouponStock>, WxErrorException> {
862        Err(WxErrorException::from_code(
863            -99,
864            "minishop_get_coupon_list 未实现(Wave 2)",
865        ))
866    }
867
868    /// 将优惠券发送给某人(对应 Java `minishopPushCouponToUser(String appid,
869    /// String openId, Integer couponId)`)。
870    async fn minishop_push_coupon_to_user(
871        &self,
872        _app_id: &str,
873        _open_id: &str,
874        _coupon_id: i32,
875    ) -> Result<WxOpenResult, WxErrorException> {
876        Err(WxErrorException::from_code(
877            -99,
878            "minishop_push_coupon_to_user 未实现(Wave 2)",
879        ))
880    }
881
882    /// 更新商城优惠券(对应 Java `minishopUpdateCoupon(String appId,
883    /// WxMinishopCoupon couponInfo)`,返回 couponId)。
884    async fn minishop_update_coupon(
885        &self,
886        _app_id: &str,
887        _coupon_info: &WxMinishopCoupon,
888    ) -> Result<i32, WxErrorException> {
889        Err(WxErrorException::from_code(
890            -99,
891            "minishop_update_coupon 未实现(Wave 2)",
892        ))
893    }
894
895    /// 更新优惠券状态(对应 Java `minishopUpdateCouponStatus(String appId,
896    /// Integer couponId, Integer status)`;1 创建 2 生效 4 作废 5 删除)。
897    async fn minishop_update_coupon_status(
898        &self,
899        _app_id: &str,
900        _coupon_id: i32,
901        _status: i32,
902    ) -> Result<WxOpenResult, WxErrorException> {
903        Err(WxErrorException::from_code(
904            -99,
905            "minishop_update_coupon_status 未实现(Wave 2)",
906        ))
907    }
908
909    /// 小商店添加商品(对应 Java `minishopGoodsAddSpu(String appId,
910    /// WxMinishopSpu spu)`,添加后需上架并过审才展示)。
911    async fn minishop_goods_add_spu(
912        &self,
913        _app_id: &str,
914        _spu: &WxMinishopSpu,
915    ) -> Result<WxMinishopAddGoodsSpuResult, WxErrorException> {
916        Err(WxErrorException::from_code(
917            -99,
918            "minishop_goods_add_spu 未实现(Wave 2)",
919        ))
920    }
921
922    /// 小商店删除商品(对应 Java `minishopGoodsDelSpu(String appId, Long
923    /// productId, Long outProductId)`,直接删除不进回收站)。
924    async fn minishop_goods_del_spu(
925        &self,
926        _app_id: &str,
927        _product_id: i64,
928        _out_product_id: i64,
929    ) -> Result<WxOpenResult, WxErrorException> {
930        Err(WxErrorException::from_code(
931            -99,
932            "minishop_goods_del_spu 未实现(Wave 2)",
933        ))
934    }
935
936    /// 小商店更新商品(对应 Java `minishopGoodsUpdateSpu(String appId,
937    /// WxMinishopSpu spu)`,更新入草稿箱,需上架过审)。
938    async fn minishop_goods_update_spu(
939        &self,
940        _app_id: &str,
941        _spu: &WxMinishopSpu,
942    ) -> Result<WxMinishopAddGoodsSpuResult, WxErrorException> {
943        Err(WxErrorException::from_code(
944            -99,
945            "minishop_goods_update_spu 未实现(Wave 2)",
946        ))
947    }
948
949    /// 上架商品(对应 Java `minishopGoodsListingSpu(String appId, Long
950    /// productId, Long outProductId)`)。
951    async fn minishop_goods_listing_spu(
952        &self,
953        _app_id: &str,
954        _product_id: i64,
955        _out_product_id: i64,
956    ) -> Result<WxOpenResult, WxErrorException> {
957        Err(WxErrorException::from_code(
958            -99,
959            "minishop_goods_listing_spu 未实现(Wave 2)",
960        ))
961    }
962
963    /// 下架商品(对应 Java `minishopGoodsDelistingSpu(String appId, Long
964    /// productId, Long outProductId)`)。
965    async fn minishop_goods_delisting_spu(
966        &self,
967        _app_id: &str,
968        _product_id: i64,
969        _out_product_id: i64,
970    ) -> Result<WxOpenResult, WxErrorException> {
971        Err(WxErrorException::from_code(
972            -99,
973            "minishop_goods_delisting_spu 未实现(Wave 2)",
974        ))
975    }
976
977    /// 小商店新增 sku 信息(对应 Java `minishiopGoodsAddSku(String appId,
978    /// WxMinishopSku sku)`,Java 方法名拼写为 minishop + Goods 少 i)。
979    async fn minishop_goods_add_sku(
980        &self,
981        _app_id: &str,
982        _sku: &WxMinishopSku,
983    ) -> Result<WxMinishopAddGoodsSpuResult, WxErrorException> {
984        Err(WxErrorException::from_code(
985            -99,
986            "minishop_goods_add_sku 未实现(Wave 2)",
987        ))
988    }
989
990    /// 小商店批量新增 sku 信息(对应 Java `minishopGoodsBatchAddSku(String
991    /// appId, List<WxMinishopSku> skuList)`)。
992    async fn minishop_goods_batch_add_sku(
993        &self,
994        _app_id: &str,
995        _sku_list: &[WxMinishopSku],
996    ) -> Result<WxOpenResult, WxErrorException> {
997        Err(WxErrorException::from_code(
998            -99,
999            "minishop_goods_batch_add_sku 未实现(Wave 2)",
1000        ))
1001    }
1002
1003    /// 小商店删除 sku 信息(对应 Java `minishopGoodsDelSku(String appId, Long
1004    /// productId, Long outProductId, String outSkuId, Long skuId)`)。
1005    async fn minishop_goods_del_sku(
1006        &self,
1007        _app_id: &str,
1008        _product_id: i64,
1009        _out_product_id: i64,
1010        _out_sku_id: &str,
1011        _sku_id: i64,
1012    ) -> Result<WxOpenResult, WxErrorException> {
1013        Err(WxErrorException::from_code(
1014            -99,
1015            "minishop_goods_del_sku 未实现(Wave 2)",
1016        ))
1017    }
1018
1019    /// 小商店更新 sku(对应 Java `minishopGoodsUpdateSku(String appId,
1020    /// WxMinishopSku sku)`)。
1021    async fn minishop_goods_update_sku(
1022        &self,
1023        _app_id: &str,
1024        _sku: &WxMinishopSku,
1025    ) -> Result<WxOpenResult, WxErrorException> {
1026        Err(WxErrorException::from_code(
1027            -99,
1028            "minishop_goods_update_sku 未实现(Wave 2)",
1029        ))
1030    }
1031
1032    /// 小商店更新 sku 价格(对应 Java `minishopGoodsUpdateSkuPrice(String
1033    /// appId, Long productId, Long outProductId, String outSkuId, Long skuId,
1034    /// Long salePrice, Long marketPrice)`)。
1035    ///
1036    /// 注意:Java 实现将 `sale_price`/`market_price` 均写成 `outSkuId`
1037    /// (WxJava 上游 bug),严格镜像(见 impl 注释)。
1038    async fn minishop_goods_update_sku_price(
1039        &self,
1040        _app_id: &str,
1041        _product_id: i64,
1042        _out_product_id: i64,
1043        _out_sku_id: &str,
1044        _sku_id: i64,
1045        _sale_price: i64,
1046        _market_price: i64,
1047    ) -> Result<WxOpenResult, WxErrorException> {
1048        Err(WxErrorException::from_code(
1049            -99,
1050            "minishop_goods_update_sku_price 未实现(Wave 2)",
1051        ))
1052    }
1053
1054    /// 小商店更新 sku 库存(对应 Java `minishopGoodsUpdateSkuStock(String
1055    /// appId, Long productId, Long outProductId, String outSkuId, Long skuId,
1056    /// Integer type, Integer stockNum)`)。
1057    async fn minishop_goods_update_sku_stock(
1058        &self,
1059        _app_id: &str,
1060        _product_id: i64,
1061        _out_product_id: i64,
1062        _out_sku_id: &str,
1063        _sku_id: i64,
1064        r#_type: i32,
1065        _stock_num: i32,
1066    ) -> Result<WxOpenResult, WxErrorException> {
1067        Err(WxErrorException::from_code(
1068            -99,
1069            "minishop_goods_update_sku_stock 未实现(Wave 2)",
1070        ))
1071    }
1072
1073    /// 小商店通用 Post 接口(对应 Java `minishopCommonPost(String appId,
1074    /// String url, String requestParam)`)。
1075    ///
1076    /// Java 实现恒 `return null` → `Ok(None)` 镜像。
1077    async fn minishop_common_post(
1078        &self,
1079        _app_id: &str,
1080        _url: &str,
1081        _request_param: &str,
1082    ) -> Result<Option<String>, WxErrorException> {
1083        Err(WxErrorException::from_code(
1084            -99,
1085            "minishop_common_post 未实现(Wave 2)",
1086        ))
1087    }
1088
1089    /// 添加抢购任务(对应 Java `addLimitDiscountGoods(String appId,
1090    /// LimitDiscountGoods limitDiscountGoods)`,返回 taskId)。
1091    async fn add_limit_discount_goods(
1092        &self,
1093        _app_id: &str,
1094        _limit_discount_goods: &LimitDiscountGoods,
1095    ) -> Result<i32, WxErrorException> {
1096        Err(WxErrorException::from_code(
1097            -99,
1098            "add_limit_discount_goods 未实现(Wave 2)",
1099        ))
1100    }
1101
1102    /// 获取抢购任务列表(对应 Java `getLimitDiscountList(String appId,
1103    /// Integer status)`;status 0 未结束 1 已结束,不填则都拉取)。
1104    async fn get_limit_discount_list(
1105        &self,
1106        _app_id: &str,
1107        _status: Option<i32>,
1108    ) -> Result<Vec<LimitDiscountGoods>, WxErrorException> {
1109        Err(WxErrorException::from_code(
1110            -99,
1111            "get_limit_discount_list 未实现(Wave 2)",
1112        ))
1113    }
1114
1115    /// 修改抢购任务状态(对应 Java `updateLimitDiscountStatus(String appId,
1116    /// Long taskId, Integer status)`,结束后不可再开启)。
1117    async fn update_limit_discount_status(
1118        &self,
1119        _app_id: &str,
1120        _task_id: i64,
1121        _status: i32,
1122    ) -> Result<WxOpenResult, WxErrorException> {
1123        Err(WxErrorException::from_code(
1124            -99,
1125            "update_limit_discount_status 未实现(Wave 2)",
1126        ))
1127    }
1128
1129    // ---- tcb 云开发(对应 Java 同名方法) ----
1130
1131    /// 查询环境共享信息(对应 Java `getShareCloudBaseEnv(List<String>
1132    /// appids)`)。
1133    async fn get_share_cloud_base_env(
1134        &self,
1135        _appids: &[String],
1136    ) -> Result<GetShareCloudBaseEnvResponse, WxErrorException> {
1137        Err(WxErrorException::from_code(
1138            -99,
1139            "get_share_cloud_base_env 未实现(Wave 2)",
1140        ))
1141    }
1142
1143    /// 获取环境信息(对应 Java `getTcbEnvList()`)。
1144    async fn get_tcb_env_list(&self) -> Result<GetTcbEnvListResponse, WxErrorException> {
1145        Err(WxErrorException::from_code(
1146            -99,
1147            "get_tcb_env_list 未实现(Wave 2)",
1148        ))
1149    }
1150
1151    /// 转换云环境(对应 Java `changeTcbEnv(String env)`)。
1152    async fn change_tcb_env(&self, _env: &str) -> Result<WxOpenResult, WxErrorException> {
1153        Err(WxErrorException::from_code(
1154            -99,
1155            "change_tcb_env 未实现(Wave 2)",
1156        ))
1157    }
1158
1159    /// 环境共享(对应 Java `shareCloudBaseEnv(ShareCloudBaseEnvRequest
1160    /// request)`)。
1161    async fn share_cloud_base_env(
1162        &self,
1163        _request: &ShareCloudBaseEnvRequest,
1164    ) -> Result<ShareCloudBaseEnvResponse, WxErrorException> {
1165        Err(WxErrorException::from_code(
1166            -99,
1167            "share_cloud_base_env 未实现(Wave 2)",
1168        ))
1169    }
1170
1171    /// 使用 AppSecret 重置第三方平台 API 调用次数(对应 Java
1172    /// `clearQuotaV2(String appid)`,裸 post 不经 token 注入)。
1173    async fn clear_quota_v2(&self, _appid: &str) -> Result<WxOpenResult, WxErrorException> {
1174        Err(WxErrorException::from_code(
1175            -99,
1176            "clear_quota_v2 未实现(Wave 2)",
1177        ))
1178    }
1179
1180    // ---- 订单页 path 与服务器域名(对应 Java 同名方法) ----
1181
1182    /// 申请设置订单页 path 信息(对应 Java `applySetOrderPathInfo(WxOpenMa
1183    /// ApplyOrderPathInfo info)`,一次提交不超过 100 个 appid)。
1184    async fn apply_set_order_path_info(
1185        &self,
1186        _info: &WxOpenMaApplyOrderPathInfo,
1187    ) -> Result<WxOpenResult, WxErrorException> {
1188        Err(WxErrorException::from_code(
1189            -99,
1190            "apply_set_order_path_info 未实现(Wave 2)",
1191        ))
1192    }
1193
1194    /// 设置第三方平台服务器域名(对应 Java `modifyWxaServerDomain(String
1195    /// action, List<String> requestDomains, ...)`;action:add 添加 /
1196    /// delete 删除 / set 覆盖 / get 获取,get 时不需要域名参数)。
1197    async fn modify_wxa_server_domain(
1198        &self,
1199        _action: &str,
1200        _request_domains: &[String],
1201        _ws_request_domains: &[String],
1202        _upload_domains: &[String],
1203        _download_domains: &[String],
1204        _udp_domains: &[String],
1205        _tcp_domains: &[String],
1206    ) -> Result<WxOpenMaDomainResult, WxErrorException> {
1207        Err(WxErrorException::from_code(
1208            -99,
1209            "modify_wxa_server_domain 未实现(Wave 2)",
1210        ))
1211    }
1212
1213    /// 获取第三方平台业务域名校验文件(对应 Java `getDomainConfirmFile()`)。
1214    async fn get_domain_confirm_file(
1215        &self,
1216    ) -> Result<WxOpenMaDomainConfirmFileResult, WxErrorException> {
1217        Err(WxErrorException::from_code(
1218            -99,
1219            "get_domain_confirm_file 未实现(Wave 2)",
1220        ))
1221    }
1222
1223    /// 设置第三方平台业务域名(对应 Java `modifyWxaJumpDomain(String action,
1224    /// List<String> domainList)`,直接返回字符串)。
1225    async fn modify_wxa_jump_domain(
1226        &self,
1227        _action: &str,
1228        _domain_list: &[String],
1229    ) -> Result<String, WxErrorException> {
1230        Err(WxErrorException::from_code(
1231            -99,
1232            "modify_wxa_jump_domain 未实现(Wave 2)",
1233        ))
1234    }
1235
1236    /// 设置第三方平台业务域名(对应 Java `modifyWxaJumpDomainInfo(String
1237    /// action, List<String> domainList)`,解析为 webview domain 信息)。
1238    async fn modify_wxa_jump_domain_info(
1239        &self,
1240        _action: &str,
1241        _domain_list: &[String],
1242    ) -> Result<WxOpenMaWebDomainResult, WxErrorException> {
1243        Err(WxErrorException::from_code(
1244            -99,
1245            "modify_wxa_jump_domain_info 未实现(Wave 2)",
1246        ))
1247    }
1248}