diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5981545f..9da7cc27 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -33,6 +33,34 @@
[展开查看]
+- Release 3.0.0 (2024-03-09)
+
+ - **新增**:新增 URL Link v2、URL Schema v2、二维码 v2、订阅消息 v2、推广计划 v2、流量主 v2 等相关接口。
+
+ - **新增**:新增内容安全图片检测 v3、普通二维码绑定 v3 等相关接口。
+
+ - **新增**:新增线索组件、视频能力、搜索能力、任务能力、用户信息、分享等相关接口。
+
+ - **新增**:新增小程序能力申请、抖音号绑定等相关接口。
+
+ - **新增**:新增泛知识角色系统抖音号绑定相关接口。
+
+ - **新增**:新增服务商平台代开发小程序授权 v2、代开发小程序模板管理 v2、代开发小程序基础信息管理 v2、代开发小程序开发管理 v2 等相关接口。
+
+ - **新增**:新增服务商平台代开发小程序备案相关接口。
+
+ - **新增**:独立化直播小玩法 API 客户端,支持自动生成请求签名。
+
+ - **变更**:升级公共组件至 v3.0.0。完整变更说明请参阅迁移指南。
+
+ - **变更**:重命名客户端 `ByteDanceMicroAppClient` 为 `DouyinMicroAppClient`。
+
+ - **变更**:移除部分已废弃接口。
+
+ - **修复**:修复泛知识课程库添加课程接口模型定义错误。
+
+ - **修复**:修复担保支付相关接口 GET 请求签名错误。(_via_ [GitHub #20](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.ByteDance/pull/20))
+
- Release 2.5.0 (2023-07-17)
- **新增**:新增担保支付自动结算结果查询接口。(_via_ [GitHub #12](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.ByteDance/pull/12))
diff --git a/docs/MicroApp/Advanced_Dispose.md b/docs/MicroApp/Advanced_Dispose.md
new file mode 100644
index 00000000..cf2f55e3
--- /dev/null
+++ b/docs/MicroApp/Advanced_Dispose.md
@@ -0,0 +1,13 @@
+## 如何销毁客户端?
+
+---
+
+本功能来自于公共组件,请参阅公共组件下的相关文档:
+
+> [《SKIT.FlurlHttpClient FAQ:如何销毁客户端(避免内存泄漏)?》](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/blob/main/docs/README.md)
+
+---
+
+### 镜像站点
+
+国内用户如访问 GitHub 网络状况不佳,可在打开上述链接后,手动将域名部分的 **github.com** 替换为 **gitee.com**、剩余路径部分保持不变,即可访问。
diff --git a/docs/MicroApp/Advanced_IHttpClientFactory.md b/docs/MicroApp/Advanced_IHttpClientFactory.md
index d73d446a..48061b9b 100644
--- a/docs/MicroApp/Advanced_IHttpClientFactory.md
+++ b/docs/MicroApp/Advanced_IHttpClientFactory.md
@@ -1,10 +1,10 @@
-## 如何在 ASP.NET Core 中与 `IHttpClientFactory` 集成?
+## 如何与 `IHttpClientFactory` 集成?
---
本功能来自于公共组件,请参阅公共组件下的相关文档:
-> [《SKIT.FlurlHttpClient FAQ:如何在 ASP.NET Core 中与 IHttpClientFactory 集成?》](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/blob/main/docs/FAQ_IHttpClientFactory.md)
+> [《SKIT.FlurlHttpClient FAQ:如何与 IHttpClientFactory 集成?》](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/blob/main/docs/README.md)
---
diff --git a/docs/MicroApp/Advanced_Interceptor.md b/docs/MicroApp/Advanced_Interceptor.md
index 2bc28620..23f63eb1 100644
--- a/docs/MicroApp/Advanced_Interceptor.md
+++ b/docs/MicroApp/Advanced_Interceptor.md
@@ -4,7 +4,7 @@
本功能来自于公共组件,请参阅公共组件下的相关文档:
-> [《SKIT.FlurlHttpClient FAQ:如何使用拦截器?》](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/blob/main/docs/FAQ_Interceptor.md)
+> [《SKIT.FlurlHttpClient FAQ:如何使用拦截器?》](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/blob/main/docs/README.md)
---
diff --git a/docs/MicroApp/Advanced_JsonSerializer.md b/docs/MicroApp/Advanced_JsonSerializer.md
index a9df787e..251fe34f 100644
--- a/docs/MicroApp/Advanced_JsonSerializer.md
+++ b/docs/MicroApp/Advanced_JsonSerializer.md
@@ -4,7 +4,7 @@
本功能来自于公共组件,请参阅公共组件下的相关文档:
-> [《SKIT.FlurlHttpClient FAQ:如何指定 JSON 序列化器?》](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/blob/main/docs/FAQ_JsonSerializer.md)
+> [《SKIT.FlurlHttpClient FAQ:如何指定 JSON 序列化器?》](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/blob/main/docs/README.md)
---
diff --git a/docs/MicroApp/Basic_EventDeserialization.md b/docs/MicroApp/Basic_EventDeserialization.md
index 35e37bc8..f5a89302 100644
--- a/docs/MicroApp/Basic_EventDeserialization.md
+++ b/docs/MicroApp/Basic_EventDeserialization.md
@@ -2,46 +2,46 @@
---
-对于字节小程序推送过来的回调通知事件,本库封装了直接解析成事件模型的扩展方法,下面给出一个示例:
+对于抖音小程序推送过来的回调通知事件,本库封装了直接解析成事件模型的扩展方法,下面给出一个示例:
```csharp
/* 如果是 JSON 格式的通知内容,以 text 事件为例 */
-string callbackJson = "{ ... }";
-var callbackModel = client.DeserializeEventFromJson(callbackJson);
+string webhookJson = "{ ... }";
+var webhookModel = client.DeserializeEventFromJson(webhookJson);
/* 如果是 XML 格式的通知内容,以 text 事件为例 */
-string callbackXml = " ... ";
-var callbackModel = client.DeserializeEventFromXml(callbackXml);
+string webhookXml = " ... ";
+var webhookModel = client.DeserializeEventFromXml(webhookXml);
```
-完整的回调通知模型定义可以参考项目目录下的 _src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Events_、_src/SKIT.FlurlHttpClient.ByteDance.Api/SDK/ProductApi/Events_、_src/SKIT.FlurlHttpClient.ByteDance.Api/SDK/OpenApi/Events_ 目录。
+完整的回调通知模型定义可以参考项目目录下的 _src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Events_、_src/SKIT.FlurlHttpClient.ByteDance.Api/ExtendedSDK/OpenApi/Events_、_src/SKIT.FlurlHttpClient.ByteDance.Api/ExtendedSDK/ProductApi/Events_ 目录。
---
### 事件类型:
-由于字节小程序会将全部事件推送到同一个回调通知地址上,开发者需要根据事件类型才能决定如何反序列化。
+由于抖音小程序会将全部事件推送到同一个回调通知地址上,开发者需要根据事件类型才能决定如何反序列化。
这里给出两种解决方案。
一种是利用 `System.Xml.Linq`:
```csharp
-XDocument xDoc = XDocument.Parse(callbackXml);
+XDocument xDoc = XDocument.Parse(webhookXml);
string msgType = xDoc.Root?.Element("MsgType")?.Value?.ToUpper();
```
另一种是利用本库的扩展方法:
```csharp
-ByteDanceMicroAppEvent eventModel = client.DeserializeEventFromXml(callbackXml);
+ByteDanceMicroAppEvent eventModel = client.DeserializeEventFromXml(webhookXml);
string msgType = eventModel.MessageType?.ToUpper();
switch (msgType)
{
case "TEXT":
{
- var callbackModel = client.DeserializeEventFromXml(callbackXml);
+ var webhookModel = client.DeserializeEventFromXml(webhookXml);
}
break;
// 省略其他情况
diff --git a/docs/MicroApp/Basic_EventSignatureVerification.md b/docs/MicroApp/Basic_EventSignatureVerification.md
index e6c0bf9c..a7661713 100644
--- a/docs/MicroApp/Basic_EventSignatureVerification.md
+++ b/docs/MicroApp/Basic_EventSignatureVerification.md
@@ -4,25 +4,24 @@
> 请先自行阅读:
>
-> [《字节小程序文档 - 消息推送客服:验证消息来自今日头条》](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/component/message-push-customer-service)
+> [《抖音小程序文档 - 消息推送客服:验证消息来自今日头条》](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/component/message-push-customer-service)
同样的,你既可以利用本库提供的 `SHA1Utility` 工具类自行进行签名验证,也可以通过扩展方法实现:
```csharp
/* 在初始化客户端时需指定服务器推送的相关参数 */
-var options = new ByteDanceMicroAppClientOptions()
+var options = new DouyinMicroAppClientOptions()
{
- AppId = "字节小程序 AppId",
- AppSecret = "字节小程序 AppSecret",
+ // 其他配置项略
PushToken = "服务器推送的 Token"
};
-var client = new ByteDanceMicroAppClient(options);
+var client = DouyinMicroAppClientBuilder.Create(options).Build();
-/* 验证字节小程序服务器 */
+/* 验证抖音服务器 */
bool ret = client.VerifyEventSignatureForEcho(
- callbackTimestamp: "字节小程序回调通知中的 timestamp 字段",
- callbackNonce: "字节小程序回调通知中的 nonce 字段",
- callbackMessage: "头条回调通知中的 msg 字段",
- callbackSignature: "头条回调通知中的 signature 字段"
+ webhookTimestamp: "抖音小程序回调通知中的 timestamp 字段",
+ webhookNonce: "抖音小程序回调通知中的 nonce 字段",
+ webhookMsg: "抖音回调通知中的 msg 字段",
+ webhookSignature: "抖音回调通知中的 signature 字段"
);
```
diff --git a/docs/MicroApp/Basic_Extensions.md b/docs/MicroApp/Basic_Extensions.md
index ab08244d..855bd998 100644
--- a/docs/MicroApp/Basic_Extensions.md
+++ b/docs/MicroApp/Basic_Extensions.md
@@ -5,26 +5,26 @@
如果有某些接口本库尚未支持,你可按照下面的示例自行扩展:
```csharp
-/* 继承 ByteDanceMicroAppRequest 实现自定义请求类 */
-public class MyFakeRequest : ByteDanceMicroAppRequest
+/* 继承 DouyinMicroAppRequest 实现自定义请求类 */
+public class MyFakeRequest : DouyinMicroAppRequest
{
[Newtonsoft.Json.JsonProperty("my_fake_props")]
[System.Text.Json.Serialization.JsonPropertyName("my_fake_props")]
public string MyFakeProps { get; set; }
}
-/* 继承 ByteDanceMicroAppResponse 实现自定义响应类 */
-public class MyFakeResponse : ByteDanceMicroAppResponse
+/* 继承 DouyinMicroAppResponse 实现自定义响应类 */
+public class MyFakeResponse : DouyinMicroAppResponse
{
[Newtonsoft.Json.JsonProperty("my_fake_props")]
[System.Text.Json.Serialization.JsonPropertyName("my_fake_props")]
public string MyFakeProps { get; set; }
}
-/* 扩展 ByteDanceMicroAppClient 方法 */
+/* 扩展 DouyinMicroAppClient 方法 */
public static class MyFakeClientExtensions
{
- public static async Task ExecuteMyFakeAsync(this ByteDanceMicroAppClient client, MyFakeRequest request, CancellationToken cancellationToken = default)
+ public static async Task ExecuteMyFakeAsync(this DouyinMicroAppClient client, MyFakeRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
@@ -41,16 +41,16 @@ public static class MyFakeClientExtensions
同样的,你也可自行扩展回调通知事件模型:
```csharp
-/* 继承 ByteDanceMicroAppEvent 实现自定义的 JSON 格式的回调通知事件 */
-public class MyFakeEvent : ByteDanceMicroAppEvent, ByteDanceMicroAppEvent.Serialization.IJsonSerializable
+/* 继承 DouyinMicroAppEvent 实现自定义的 JSON 格式的回调通知事件 */
+public class MyFakeEvent : DouyinMicroAppEvent, DouyinMicroAppEvent.Serialization.IJsonSerializable
{
[Newtonsoft.Json.JsonProperty("my_fake_props")]
[System.Text.Json.Serialization.JsonPropertyName("my_fake_props")]
public string MyFakeProps { get; set; }
}
-/* 继承 ByteDanceMicroAppEvent 实现自定义的 XML 格式的回调通知事件 */
-public class MyFakeEvent : ByteDanceMicroAppEvent, ByteDanceMicroAppEvent.Serialization.IXmlSerializable
+/* 继承 DouyinMicroAppEvent 实现自定义的 XML 格式的回调通知事件 */
+public class MyFakeEvent : DouyinMicroAppEvent, DouyinMicroAppEvent.Serialization.IXmlSerializable
{
[System.Xml.Serialization.XmlElement("my_fake_props")]
public string MyFakeProps { get; set; }
diff --git a/docs/MicroApp/Basic_ModelDefinition.md b/docs/MicroApp/Basic_ModelDefinition.md
index 68b68ac0..fb0f770e 100644
--- a/docs/MicroApp/Basic_ModelDefinition.md
+++ b/docs/MicroApp/Basic_ModelDefinition.md
@@ -8,11 +8,11 @@
再有,每个对象的命名与官方文档的接口地址大体保持一致。例如刚刚提到的发送订阅消息,它的接口地址是 `[POST] /apps/message/custom/send`,将其中的反斜杠去掉、并以大驼峰命名法的方式调整它,就可以得到前文提到的几个对象了。如果路由中带有版本信息,那么版本号一般都在结尾处,例如接口 `[POST] /v2/tags/image` 对应的是 `TagsImageV2`。
-完整的模型定义可以参考项目目录下的 _src/SKIT.FlurlHttpClient.ByteDance.Api/Models_、_src/SKIT.FlurlHttpClient.ByteDance.Api/SDK/ProductApi/Models_、_src/SKIT.FlurlHttpClient.ByteDance.Api/SDK/OpenApi/Models_ 目录。
+完整的模型定义可以参考项目目录下的 _src/SKIT.FlurlHttpClient.ByteDance.Api/Models_、_src/SKIT.FlurlHttpClient.ByteDance.Api/ExtendedSdk/OpenApi/Models_、_src/SKIT.FlurlHttpClient.ByteDance.Api/ExtendedSdk/ProductApi/Models_、_src/SKIT.FlurlHttpClient.ByteDance.Api/ExtendedSdk/RoleApi/Models_、_src/SKIT.FlurlHttpClient.ByteDance.Api/ExtendedSdk/Webcast/Models_ 目录。
---
-### 字节小程序开放平台 API 支持情况:
+### 抖音小程序开放平台 API 支持情况:
#### 1. 小程序
@@ -20,27 +20,50 @@
[展开查看]
-| | 字节 API | 备注 |
-| :-: | :------------------------------------: | :------------------: |
-| √ | 接口调用凭证 | |
-| √ | 登录 | |
-| √ | 数据缓存 | |
-| √ | 分享 | |
-| √ | 客服 | |
-| × | 交易系统 | 异构协议,需独立模块 |
-| √ | 二维码 | |
-| √ | 内容安全 | |
-| √ | 课程库 | |
-| √ | 担保支付 | |
-| √ | 评价 | |
-| √ | 订阅消息 | |
-| √ | 其它:直播间自定义封面 | |
-| √ | 其它:抖音开放平台与小程序视频打通能力 | |
-| √ | 小程序推广计划 | |
-| √ | 挂载 | |
-| √ | 分发 | |
-| √ | 引导关注抖音号 | |
-| √ | 数据分析 | |
+| | 抖音 API | 备注 |
+| :-: | :---------------------------------------: | :--------------------------------: |
+| × | 联合授权 | 异构协议,请使用 `DouyinOpen` 模块 |
+| × | 接口调用凭证:经营能力调用凭证 | 异构协议,请使用 `DouyinOpen` 模块 |
+| × | 接口调用凭证:用户授权调用凭证 | 异构协议,请使用 `DouyinOpen` 模块 |
+| √ | 接口调用凭证:非用户授权调用凭证 | |
+| × | 私聊和群聊 | 异构协议,请使用 `DouyinOpen` 模块 |
+| √ | 登录 | |
+| √ | 小程序码与小程序链接 | |
+| √ | 线索组件 | |
+| √ | 视频能力 | |
+| √ | 搜索能力 | |
+| √ | 任务能力 | |
+| × | 电商 | _开发中_ |
+| × | 生活服务 | _开发中_ |
+| √ | 用户信息 | |
+| √ | 分享 | |
+| √ | 客服 | |
+| × | 交易工具 | _开发中_ |
+| × | 小程序券 | _开发中_ |
+| × | 交易系统 | _开发中_ |
+| √ | 内容安全 | |
+| √ | 泛知识:角色系统 | |
+| √ | 泛知识:课程库 | |
+| √ | 担保支付 | |
+| √ | 评价 | |
+| √ | 其他:直播间自定义封面 | |
+| √ | 其他:抖音开放平台与小程序视频打通能力 | |
+| × | 其他:开放能力配置 | _开发中_ |
+| √ | 其他:上传资源 | |
+| × | 其他:解决方案测试实体管理 | _开发中_ |
+| √ | 订阅消息 | |
+| √ | 小程序推广计划 | |
+| √ | 挂载 | |
+| √ | 分发 | |
+| × | 数据分析 | _开发中_ |
+| √ | 服务类目 | |
+| √ | 直播间能力 | |
+| √ | 抖音开放能力 | |
+| √ | 页面结构自定义 | |
+| √ | 普通二维码绑定 | |
+| √ | 抖音号绑定 | |
+| √ | 流量主 | |
+| × | 抖店绑定 | _开发中_ |
@@ -50,7 +73,7 @@
[展开查看]
-| | 字节 API | 备注 |
+| | 抖音 API | 备注 |
| :-: | :----------: | :--: |
| √ | 接口调用凭证 | |
| √ | 登录 | |
@@ -66,13 +89,24 @@
[展开查看]
-| | 字节 API | 备注 |
-| :-: | :--------------------: | :--: |
-| √ | 授权相关接口 | |
-| √ | 域名相关接口 | |
-| √ | 模板管理接口 | |
-| √ | 代商家管理小程序 | |
-| √ | 代商家管理小程序 | |
-| √ | 代商家入驻抖音开放平台 | |
+| | 抖音 API | 备注 |
+| :-: | :----------------------------------: | :------: |
+| √ | 代开发小程序:上传资源 | |
+| √ | 代开发小程序:授权 | |
+| √ | 代开发小程序:域名 | |
+| √ | 代开发小程序:模板管理 | |
+| √ | 代开发小程序:代商家管理小程序 | |
+| √ | 代开发小程序:代商家入驻抖音开放平台 | |
+| × | 代开发生活服务商家应用 | _开发中_ |
+
+#### 4. 直播小玩法
+
+
+
+[展开查看]
+
+| | 抖音 API | 备注 |
+| :-: | :------: | :--: |
+| √ | 直播能力 | |
diff --git a/docs/MicroApp/README.md b/docs/MicroApp/README.md
index 63564402..876f87aa 100644
--- a/docs/MicroApp/README.md
+++ b/docs/MicroApp/README.md
@@ -1,19 +1,25 @@
# SKIT.FlurlHttpClient.ByteDance.MicroApp
-基于 `Flurl.Http` 的[字节小程序开放平台](https://microapp.bytedance.com/) HTTP API SDK。
+基于 `Flurl.Http` 的[抖音小程序开放平台](https://microapp.bytedance.com/) HTTP API SDK。
+
+本模块仅支持抖音小程序专属的 API,如需接入与抖音开放平台共享的 API,请移步 [`SKIT.FlurlHttpClient.ByteDance.DouyinOpen`](../DouyinOpen/README.md) 模块。
---
## 功能
-- 基于字节小程序开放平台 API 封装。
-- 提供了字节小程序所需的 AES、MD5、SHA-1、HMAC-SHA-256 等算法工具类。
+- 基于抖音小程序开放平台 API 封装。
+- 提供了抖音小程序所需的 RSA、AES、MD5、SHA-1、HMAC-SHA-256 等算法工具类。
- 提供了解析回调通知事件等扩展方法。
+- 配合 [SKIT.FlurlHttpClient.ByteDance.DouyinOpen](../DouyinOpen/README.md) 模块,可无缝对接抖音开放平台。
---
## 快速入门
+> [!IMPORTANT]
+> 此目录下的文档适用于 v3.x 版本的模块。如果你正在使用 2.x 版本,请移步至 GitHub/Gitee 的已归档分支。
+
### 安装:
提示:如果你使用 Visual Studio NuGet 管理器图形化界面,请在搜索结果中勾选“**包括预发行版**”。
@@ -29,41 +35,15 @@
### 初始化:
```csharp
-/* 以基础 API 为例 */
using SKIT.FlurlHttpClient.ByteDance.MicroApp;
-var options = new ByteDanceMicroAppClientOptions()
+var options = new DouyinMicroAppClientOptions()
{
- Endpoints = ByteDanceMicroAppEndpoints.API_MINIAPP, // 指定接入点。需注意小程序、小游戏拥有不同的接入点。
- AppId = "字节小程序 AppId",
- AppSecret = "字节小程序 AppSecret",
+ AppId = "抖音小程序 AppId",
+ AppSecret = "抖音小程序 AppSecret",
ECPaySalt = "担保支付相关服务的密钥,不用则不填"
};
-var client = new ByteDanceMicroAppClient(options);
-
-
-
-/* 以泛知识课程库 API 为例 */
-using SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.ProductApi;
-
-var options = new ByteDanceMicroAppProductApiClientOptions()
-{
- AppId = "字节小程序 AppId",
- AppSecret = "字节小程序 AppSecret"
-};
-var client = new ByteDanceMicroAppProductApiClient(options);
-
-
-
-/* 以服务商平台 API 为例 */
-using SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi;
-
-var options = new ByteDanceMicroAppOpenApiClientOptions()
-{
- ComponentAppId = "字节小程序第三方应用 AppId",
- ComponentAppSecret = "字节小程序第三方应用 AppSecret"
-};
-var client = new ByteDanceMicroAppOpenApiClient(options);
+var client = DouyinMicroAppClientBuilder.Create(options).Build();
```
### 请求 & 响应:
@@ -87,16 +67,77 @@ if (response.IsSuccessful())
}
else
{
- Console.WriteLine("错误代码:" + response.ErrorCode);
- Console.WriteLine("错误描述:" + response.ErrorMessage);
+ Console.WriteLine("错误代码:" + response.ErrorNumber);
+ Console.WriteLine("错误描述:" + response.ErrorTips);
}
```
+### 独立的扩展客户端(服务商平台、泛知识课程库、泛知识角色系统、直播小玩法等):
+
+部分 API 的接入点、接口模型公共参数等配置项与基础 API 完全不同,需要使用独立的扩展客户端。
+
+- 服务商平台:
+
+```csharp
+using SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi;
+
+var options = new DouyinMicroAppOpenApiClientOptions()
+{
+ ComponentAppId = "第三方应用 AppId",
+ ComponentAppSecret = "第三方应用 AppSecret"
+};
+var client = DouyinMicroAppOpenApiClientBuilder.Create(options).Build();
+```
+
+- 泛知识课程库:
+
+```csharp
+using SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.ProductApi;
+
+var options = new DouyinMicroAppProductApiClientOptions()
+{
+ AppId = "抖音小程序 AppId",
+ AppSecret = "抖音小程序 AppSecret"
+};
+var client = DouyinMicroAppProductApiClientBuilder.Create(options).Build();
+```
+
+- 泛知识角色系统:
+
+```csharp
+using SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.RoleApi;
+
+var options = new DouyinMicroAppRoleApiClientOptions()
+{
+ AppId = "抖音小程序 AppId",
+ AppSecret = "抖音小程序 AppSecret"
+};
+var client = DouyinMicroAppRoleApiClientBuilder.Create(options).Build();
+```
+
+- 直播小玩法:
+
+```csharp
+using SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.Webcast;
+
+var options = new DouyinMicroAppWebcastClientOptions()
+{
+ AppId = "抖音小程序 AppId",
+ AppSecret = "抖音小程序 AppSecret",
+ ApplicationPublicKeyVersion = "应用密钥公钥版本号",
+ ApplicationPrivateKey = "应用密钥私钥",
+ PlatformPublicKey = "平台密钥公钥"
+};
+var client = DouyinMicroAppWebcastClientBuilder.Create(options).Build();
+```
+
+这些扩展客户端在用法上基础客户端完全相同,只需引入各自的命名空间即可。
+
---
## 基础用法
-- [如何快速找到需要调用的 API 模型类名 / 方法名?](./Basic_ModelDefinition.md)
+- ⭐ [如何快速找到需要调用的 API 模型类名 / 方法名?](./Basic_ModelDefinition.md)
- [如何解析回调通知事件?](./Basic_EventDeserialization.md)
@@ -106,9 +147,11 @@ else
---
-## 快速高级技巧入门
+## 高级技巧
+
+- [如何销毁客户端?](./Advanced_Dispose.md)
-- [如何在 ASP.NET Core 中与 `IHttpClientFactory` 集成?](./Advanced_IHttpClientFactory.md)
+- [如何与 `IHttpClientFactory` 集成?](./Advanced_IHttpClientFactory.md)
- [如何指定 JSON 序列化器?](./Advanced_JsonSerializer.md)
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppClient.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppClient.cs
deleted file mode 100644
index b5f8440b..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppClient.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-using System;
-using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
-using Flurl.Http;
-
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
-{
- ///
- /// 一个字节小程序 API HTTP 客户端。
- ///
- public class ByteDanceMicroAppClient : CommonClientBase, ICommonClient
- {
- ///
- /// 获取当前客户端使用的字节小程序凭证。
- ///
- public Settings.Credentials Credentials { get; }
-
- ///
- /// 获取当前客户端使用的字节小程序 API 接入点。
- ///
- protected internal string Endpoint { get; }
-
- ///
- /// 获取当前客户端使用的字节小程序直播小玩法 API 接入点。
- ///
- protected internal string EndpointForWebcastAPI { get; }
-
- ///
- /// 用指定的配置项初始化 类的新实例。
- ///
- /// 配置项。
- public ByteDanceMicroAppClient(ByteDanceMicroAppClientOptions options)
- : base()
- {
- if (options == null) throw new ArgumentNullException(nameof(options));
-
- Credentials = new Settings.Credentials(options);
- Endpoint = options.Endpoint;
- EndpointForWebcastAPI = options.EndpointForWebcastAPI;
-
- FlurlClient.BaseUrl = options.Endpoint ?? ByteDanceMicroAppEndpoints.API_MINIAPP;
- FlurlClient.WithTimeout(TimeSpan.FromMilliseconds(options.Timeout));
- }
-
- ///
- /// 用指定的字节小程序 AppId、字节小程序 AppSecret 初始化 类的新实例。
- ///
- /// 字节小程序应用 AppId。
- /// 字节小程序 AppSecret。
- public ByteDanceMicroAppClient(string appId, string appSecret)
- : this(new ByteDanceMicroAppClientOptions() { AppId = appId, AppSecret = appSecret })
- {
- }
-
- ///
- /// 使用当前客户端生成一个新的 对象。
- ///
- ///
- ///
- ///
- ///
- public IFlurlRequest CreateRequest(ByteDanceMicroAppRequest request, HttpMethod method, params object[] urlSegments)
- {
- IFlurlRequest flurlRequest = FlurlClient.Request(urlSegments).WithVerb(method);
-
- if (request.Timeout != null)
- {
- flurlRequest.WithTimeout(TimeSpan.FromMilliseconds(request.Timeout.Value));
- }
-
- return flurlRequest;
- }
-
- ///
- /// 异步发起请求。
- ///
- ///
- ///
- ///
- ///
- ///
- public async Task SendRequestAsync(IFlurlRequest flurlRequest, HttpContent? httpContent = null, CancellationToken cancellationToken = default)
- where T : ByteDanceMicroAppResponse, new()
- {
- if (flurlRequest == null) throw new ArgumentNullException(nameof(flurlRequest));
-
- try
- {
- using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken);
- return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken);
- }
- catch (FlurlHttpTimeoutException ex)
- {
- throw new Exceptions.ByteDanceMicroAppRequestTimeoutException(ex.Message, ex);
- }
- catch (FlurlHttpException ex)
- {
- throw new ByteDanceMicroAppException(ex.Message, ex);
- }
- }
-
- ///
- /// 异步发起请求。
- ///
- ///
- ///
- ///
- ///
- ///
- public async Task SendRequestWithJsonAsync(IFlurlRequest flurlRequest, object? data = null, CancellationToken cancellationToken = default)
- where T : ByteDanceMicroAppResponse, new()
- {
- if (flurlRequest == null) throw new ArgumentNullException(nameof(flurlRequest));
-
- try
- {
- bool isSimpleRequest = data == null ||
- flurlRequest.Verb == HttpMethod.Get ||
- flurlRequest.Verb == HttpMethod.Head ||
- flurlRequest.Verb == HttpMethod.Options;
- using IFlurlResponse flurlResponse = isSimpleRequest ?
- await base.SendRequestAsync(flurlRequest, null, cancellationToken) :
- await base.SendRequestWithJsonAsync(flurlRequest, data, cancellationToken);
- return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken);
- }
- catch (FlurlHttpTimeoutException ex)
- {
- throw new Exceptions.ByteDanceMicroAppRequestTimeoutException(ex.Message, ex);
- }
- catch (FlurlHttpException ex)
- {
- throw new ByteDanceMicroAppException(ex.Message, ex);
- }
- }
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppClientOptions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppClientOptions.cs
deleted file mode 100644
index 5d9a12a1..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppClientOptions.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
-{
- ///
- /// 一个用于构造 时使用的配置项。
- ///
- public class ByteDanceMicroAppClientOptions
- {
- ///
- /// 获取或设置请求超时时间(单位:毫秒)。
- /// 默认值:30000
- ///
- public int Timeout { get; set; } = 30 * 1000;
-
- ///
- /// 获取或设置字节小程序 API 入口点。
- /// 默认值:
- ///
- public string Endpoint { get; set; } = ByteDanceMicroAppEndpoints.API_MINIAPP;
-
- ///
- /// 获取或设置字节小程序直播小玩法 API 入口点。
- /// 默认值:
- ///
- public string EndpointForWebcastAPI { get; set; } = ByteDanceMicroAppWebcastEndpoints.DEFAULT;
-
- ///
- /// 获取或设置字节小程序 AppId。
- ///
- public string AppId { get; set; } = default!;
-
- ///
- /// 获取或设置字节小程序 AppSecret。
- ///
- public string AppSecret { get; set; } = default!;
-
- ///
- /// 获取或设置头条服务器推送的 Token。
- ///
- public string? PushToken { get; set; }
-
- ///
- /// 获取或设置头条服务器推送的 EncodingAESKey。
- ///
- public string? PushEncodingAESKey { get; set; }
-
- ///
- /// 获取或设置用于担保支付请求签名的密钥。
- ///
- public string? ECPaySalt { get; set; }
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppEndpoints.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppEndpoints.cs
deleted file mode 100644
index 286ade5c..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppEndpoints.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
-{
- ///
- /// 字节小程序 API 接口域名。
- ///
- public static class ByteDanceMicroAppEndpoints
- {
- ///
- /// 小程序 API 域名(默认)。
- ///
- public const string API_MINIAPP = "https://developer.toutiao.com/api";
-
- ///
- /// 小程序 API 沙盒环境域名。
- ///
- public const string API_MINIAPP_SANDBOX = "https://open-sandbox.douyin.com/api";
-
- ///
- /// 小游戏 API 域名。
- ///
- public const string API_MINIGAME = "https://minigame.zijieapi.com/mgplatform/api";
- }
-
- ///
- /// 字节小程序直播小玩法 API 接口域名。
- ///
- public static class ByteDanceMicroAppWebcastEndpoints
- {
- ///
- /// 主域名(默认)。
- ///
- public const string DEFAULT = "https://webcast.bytedance.com/api";
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppEvent.cs
deleted file mode 100644
index a25f90f5..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppEvent.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
-{
- ///
- /// 表示字节小程序 API 消息推送事件的基类。
- ///
- public class ByteDanceMicroAppEvent
- {
- public static class Serialization
- {
- [Newtonsoft.Json.JsonObject]
- public interface IJsonSerializable
- {
- }
-
- [System.Xml.Serialization.XmlRoot("xml")]
- public interface IXmlSerializable
- {
- }
- }
-
- ///
- /// 获取或设置消息接收方账号。
- ///
- [Newtonsoft.Json.JsonProperty("ToUserName")]
- [System.Text.Json.Serialization.JsonPropertyName("ToUserName")]
- [System.Xml.Serialization.XmlElement("ToUserName", IsNullable = true)]
- public virtual string? ToUserName { get; set; }
-
- ///
- /// 获取或设置消息发送方账号。
- ///
- [Newtonsoft.Json.JsonProperty("FromUserName")]
- [System.Text.Json.Serialization.JsonPropertyName("FromUserName")]
- [System.Xml.Serialization.XmlElement("FromUserName", IsNullable = true)]
- public virtual string? FromUserName { get; set; }
-
- ///
- /// 获取或设置消息类型。
- ///
- [Newtonsoft.Json.JsonProperty("MsgType")]
- [System.Text.Json.Serialization.JsonPropertyName("MsgType")]
- [System.Xml.Serialization.XmlElement("MsgType", IsNullable = true)]
- public virtual string? MessageType { get; set; }
-
- ///
- /// 获取或设置消息创建时间戳。
- ///
- [Newtonsoft.Json.JsonProperty("CreateTime")]
- [System.Text.Json.Serialization.JsonPropertyName("CreateTime")]
- [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
- [System.Xml.Serialization.XmlElement("CreateTime")]
- public virtual long CreateTimestamp { get; set; }
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppException.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppException.cs
deleted file mode 100644
index 28afcb64..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppException.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
-{
- ///
- /// 字节小程序 API 出错时引发的异常。
- ///
- public class ByteDanceMicroAppException : CommonExceptionBase
- {
- ///
- public ByteDanceMicroAppException()
- {
- }
-
- ///
- public ByteDanceMicroAppException(string message)
- : base(message)
- {
- }
-
- ///
- public ByteDanceMicroAppException(string message, Exception innerException)
- : base(message, innerException)
- {
- }
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppRequest.cs
deleted file mode 100644
index f74d1c90..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppRequest.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
-{
- ///
- /// 字节小程序 API 请求的基类。
- ///
- public abstract class ByteDanceMicroAppRequest : ICommonRequest
- {
- ///
- /// 获取或设置请求超时时间(单位:毫秒)。如果不指定将使用构造 时的 参数,这在需要指定特定耗时请求(比如上传或下载文件)的超时时间时很有用。
- ///
- [Newtonsoft.Json.JsonIgnore]
- [System.Text.Json.Serialization.JsonIgnore]
- public virtual int? Timeout { get; set; }
-
- ///
- /// 获取或设置字节小程序的 AccessToken。
- /// 注意:部分第三方平台的接口中该字段表示授权方的 AuthorizerAccessToken。
- ///
- [Newtonsoft.Json.JsonIgnore]
- [System.Text.Json.Serialization.JsonIgnore]
- public virtual string? AccessToken { get; set; }
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppResponse.cs
deleted file mode 100644
index 256d8db7..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ByteDanceMicroAppResponse.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-using System.Collections.Generic;
-
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
-{
- ///
- /// 字节小程序 API 响应的基类。
- ///
- public abstract class ByteDanceMicroAppResponse : ICommonResponse
- {
- ///
- ///
- ///
- int ICommonResponse.RawStatus { get; set; }
-
- ///
- ///
- ///
- IDictionary ICommonResponse.RawHeaders { get; set; } = default!;
-
- ///
- ///
- ///
- byte[] ICommonResponse.RawBytes { get; set; } = default!;
-
- ///
- /// 获取原始的 HTTP 响应状态码。
- ///
- [Newtonsoft.Json.JsonIgnore]
- [System.Text.Json.Serialization.JsonIgnore]
- public int RawStatus
- {
- get { return ((ICommonResponse)this).RawStatus; }
- internal set { ((ICommonResponse)this).RawStatus = value; }
- }
-
- ///
- /// 获取原始的 HTTP 响应表头集合。
- ///
- [Newtonsoft.Json.JsonIgnore]
- [System.Text.Json.Serialization.JsonIgnore]
- public IDictionary RawHeaders
- {
- get { return ((ICommonResponse)this).RawHeaders; }
- internal set { ((ICommonResponse)this).RawHeaders = value; }
- }
-
- ///
- /// 获取原始的 HTTP 响应正文。
- ///
- [Newtonsoft.Json.JsonIgnore]
- [System.Text.Json.Serialization.JsonIgnore]
- public byte[] RawBytes
- {
- get { return ((ICommonResponse)this).RawBytes; }
- internal set { ((ICommonResponse)this).RawBytes = value; }
- }
-
- ///
- /// 获取字节小程序 API 返回的详细错误号。
- ///
- [Newtonsoft.Json.JsonProperty("errcode")]
- [System.Text.Json.Serialization.JsonPropertyName("errcode")]
- public virtual long ErrorCode { get; set; }
-
- ///
- /// 获取字节小程序 API 返回的错误描述。
- ///
- [Newtonsoft.Json.JsonProperty("errmsg")]
- [System.Text.Json.Serialization.JsonPropertyName("errmsg")]
- public virtual string? ErrorMessage { get; set; }
-
- ///
- /// 获取字节小程序 API 返回的日志 ID。
- ///
- [Newtonsoft.Json.JsonProperty("log_id")]
- [System.Text.Json.Serialization.JsonPropertyName("log_id")]
- [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))]
- public virtual string? LogId { get; set; }
-
- ///
- /// 获取一个值,该值指示调用字节小程序 API 是否成功(即 HTTP 状态码为 200、且 "errcode" 值为 0)。
- ///
- ///
- public virtual bool IsSuccessful()
- {
- return RawStatus == 200 && ErrorCode == 0;
- }
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/Internal/Newtonsoft.Json/DateTimeOffset/CSTDateTimeOffsetConverter.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/Internal/Newtonsoft.Json/DateTimeOffset/CSTDateTimeOffsetConverter.cs
deleted file mode 100644
index 2f9d22d1..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/Internal/Newtonsoft.Json/DateTimeOffset/CSTDateTimeOffsetConverter.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-using System.Globalization;
-
-namespace Newtonsoft.Json.Converters
-{
- internal class CSTDateTimeOffsetConverter : JsonConverter
- {
- internal const string DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss zzz CST";
-
- public override bool CanRead
- {
- get { return true; }
- }
-
- public override bool CanWrite
- {
- get { return true; }
- }
-
- public override DateTimeOffset ReadJson(JsonReader reader, Type objectType, DateTimeOffset existingValue, bool hasExistingValue, JsonSerializer serializer)
- {
- if (reader.TokenType == JsonToken.Null)
- {
- return existingValue;
- }
- else if (reader.TokenType == JsonToken.String)
- {
- string? value = serializer.Deserialize(reader);
- if (string.IsNullOrEmpty(value))
- return existingValue;
-
- if (DateTimeOffset.TryParseExact(value, DATETIME_FORMAT, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out DateTimeOffset d))
- return d;
-
- if (DateTimeOffset.TryParse(value, out d))
- return d;
-
- throw new JsonSerializationException($"Could not parse String '{value}' to DateTimeOffset.");
- }
- else if (reader.TokenType == JsonToken.Date)
- {
- reader.DateFormatString = DATETIME_FORMAT;
- return serializer.Deserialize(reader);
- }
-
- throw new JsonSerializationException($"Unexpected token type '{reader.TokenType}' when deserializing. Path '{reader.Path}'.");
- }
-
- public override void WriteJson(JsonWriter writer, DateTimeOffset value, JsonSerializer serializer)
- {
- writer.WriteValue(value.ToString(DATETIME_FORMAT, DateTimeFormatInfo.InvariantInfo));
- }
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/Internal/System.Text.Json/DateTimeOffset/CSTDateTimeOffsetConverter.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/Internal/System.Text.Json/DateTimeOffset/CSTDateTimeOffsetConverter.cs
deleted file mode 100644
index a094d3c3..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/Internal/System.Text.Json/DateTimeOffset/CSTDateTimeOffsetConverter.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System.Globalization;
-using System.Text.Json.Serialization;
-
-namespace System.Text.Json.Converters
-{
- internal class CSTDateTimeOffsetConverter : JsonConverter
- {
- internal const string DATETIME_FORMAT = Newtonsoft.Json.Converters.CSTDateTimeOffsetConverter.DATETIME_FORMAT;
-
- public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
- {
- if (reader.TokenType == JsonTokenType.Null)
- {
- return default;
- }
- else if (reader.TokenType == JsonTokenType.String)
- {
- string? value = reader.GetString();
- if (string.IsNullOrEmpty(value))
- return default;
-
- if (DateTimeOffset.TryParseExact(value, DATETIME_FORMAT, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out DateTimeOffset d))
- return d;
-
- if (DateTimeOffset.TryParse(value, out d))
- return d;
-
- throw new JsonException($"Could not parse String '{value}' to DateTimeOffset.");
- }
-
- throw new JsonException($"Unexpected JSON token type '{reader.TokenType}' when reading.");
- }
-
- public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
- {
- writer.WriteStringValue(value.ToString(DATETIME_FORMAT, DateTimeFormatInfo.InvariantInfo));
- }
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/__Internal/Newtonsoft.Json/DateTimeOffset/CstDateTimeOffsetConverter.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/__Internal/Newtonsoft.Json/DateTimeOffset/CstDateTimeOffsetConverter.cs
new file mode 100644
index 00000000..42aa68e8
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/__Internal/Newtonsoft.Json/DateTimeOffset/CstDateTimeOffsetConverter.cs
@@ -0,0 +1,7 @@
+namespace Newtonsoft.Json.Converters.Internal
+{
+ internal class CstDateTimeOffsetConverter : Common.FormattedDateTimeOffsetConverterBase
+ {
+ protected override string FormatString => "yyyy-MM-dd HH:mm:ss zzz CST";
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/__Internal/System.Text.Json/DateTimeOffset/CstDateTimeOffsetConverter.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/__Internal/System.Text.Json/DateTimeOffset/CstDateTimeOffsetConverter.cs
new file mode 100644
index 00000000..94687a50
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Converters/__Internal/System.Text.Json/DateTimeOffset/CstDateTimeOffsetConverter.cs
@@ -0,0 +1,7 @@
+namespace System.Text.Json.Serialization.Internal
+{
+ internal class CstDateTimeOffsetConverter : Common.FormattedDateTimeOffsetConverterBase
+ {
+ protected override string FormatString => "yyyy-MM-dd HH:mm:ss zzz CST";
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppClient.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppClient.cs
new file mode 100644
index 00000000..843e473e
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppClient.cs
@@ -0,0 +1,103 @@
+using System;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
+{
+ ///
+ /// 一个抖音小程序 API HTTP 客户端。
+ ///
+ public class DouyinMicroAppClient : CommonClientBase, ICommonClient
+ {
+ public readonly string _BASEURL_LEGACY;
+
+ ///
+ /// 获取当前客户端使用的抖音小程序凭证。
+ ///
+ public Settings.Credentials Credentials { get; }
+
+ ///
+ /// 用指定的配置项初始化 类的新实例。
+ ///
+ /// 配置项。
+ public DouyinMicroAppClient(DouyinMicroAppClientOptions options)
+ : this(options, null)
+ {
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ internal protected DouyinMicroAppClient(DouyinMicroAppClientOptions options, HttpClient? httpClient, bool disposeClient = true)
+ : base(httpClient, disposeClient)
+ {
+ if (options is null) throw new ArgumentNullException(nameof(options));
+
+ Credentials = new Settings.Credentials(options);
+
+ FlurlClient.BaseUrl = options.Endpoint ?? DouyinMicroAppEndpoints.DEFAULT;
+ FlurlClient.WithTimeout(options.Timeout <= 0 ? Timeout.InfiniteTimeSpan : TimeSpan.FromMilliseconds(options.Timeout));
+
+ _BASEURL_LEGACY = options.EndpointForLegacy ?? DouyinMicroAppEndpoints.LEGACY_DEFAULT;
+ }
+
+ ///
+ /// 使用当前客户端生成一个新的 对象。
+ ///
+ ///
+ ///
+ ///
+ ///
+ public IFlurlRequest CreateFlurlRequest(DouyinMicroAppRequest request, HttpMethod httpMethod, params object[] urlSegments)
+ {
+ IFlurlRequest flurlRequest = base.CreateFlurlRequest(request, httpMethod, urlSegments);
+
+ return flurlRequest;
+ }
+
+ ///
+ /// 异步发起请求。
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public async Task SendFlurlRequestAsync(IFlurlRequest flurlRequest, HttpContent? httpContent = null, CancellationToken cancellationToken = default)
+ where T : DouyinMicroAppResponse, new()
+ {
+ if (flurlRequest is null) throw new ArgumentNullException(nameof(flurlRequest));
+
+ using IFlurlResponse flurlResponse = await base.SendFlurlRequestAsync(flurlRequest, httpContent, cancellationToken).ConfigureAwait(false);
+ return await WrapFlurlResponseAsJsonAsync(flurlResponse, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步发起请求。
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public async Task SendFlurlRequestAsJsonAsync(IFlurlRequest flurlRequest, object? data = null, CancellationToken cancellationToken = default)
+ where T : DouyinMicroAppResponse, new()
+ {
+ if (flurlRequest is null) throw new ArgumentNullException(nameof(flurlRequest));
+
+ bool isSimpleRequest = data is null ||
+ flurlRequest.Verb == HttpMethod.Get ||
+ flurlRequest.Verb == HttpMethod.Head ||
+ flurlRequest.Verb == HttpMethod.Options;
+ using IFlurlResponse flurlResponse = isSimpleRequest ?
+ await base.SendFlurlRequestAsync(flurlRequest, null, cancellationToken) :
+ await base.SendFlurlRequestAsJsonAsync(flurlRequest, data, cancellationToken).ConfigureAwait(false);
+ return await WrapFlurlResponseAsJsonAsync(flurlResponse, cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppClientBuilder.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppClientBuilder.cs
new file mode 100644
index 00000000..22efdb02
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppClientBuilder.cs
@@ -0,0 +1,94 @@
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
+{
+ ///
+ /// 用于构造 实例的构造器。
+ ///
+ public partial class DouyinMicroAppClientBuilder : ICommonClientBuilder
+ {
+ private readonly DouyinMicroAppClientOptions _options;
+ private readonly IList> _configures;
+ private readonly IList _interceptors;
+ private HttpClient? _httpClient;
+ private bool? _disposeClient;
+
+ private DouyinMicroAppClientBuilder(DouyinMicroAppClientOptions options)
+ {
+ _options = options;
+ _configures = new List>();
+ _interceptors = new List();
+ }
+
+ ICommonClientBuilder ICommonClientBuilder.ConfigureSettings(Action configure)
+ {
+ return ConfigureSettings(configure);
+ }
+
+ ICommonClientBuilder ICommonClientBuilder.UseInterceptor(HttpInterceptor interceptor)
+ {
+ return UseInterceptor(interceptor);
+ }
+
+ ICommonClientBuilder ICommonClientBuilder.UseHttpClient(HttpClient httpClient, bool disposeClient)
+ {
+ return UseHttpClient(httpClient, disposeClient);
+ }
+
+ public DouyinMicroAppClientBuilder ConfigureSettings(Action configure)
+ {
+ if (configure is null) throw new ArgumentNullException(nameof(configure));
+
+ _configures.Add(configure);
+ return this;
+ }
+
+ public DouyinMicroAppClientBuilder UseInterceptor(HttpInterceptor interceptor)
+ {
+ if (interceptor is null) throw new ArgumentNullException(nameof(interceptor));
+
+ _interceptors.Add(interceptor);
+ return this;
+ }
+
+ public DouyinMicroAppClientBuilder UseHttpClient(HttpClient httpClient, bool disposeClient = true)
+ {
+ if (httpClient is null) throw new ArgumentNullException(nameof(httpClient));
+
+ _httpClient = httpClient;
+ _disposeClient = disposeClient;
+ return this;
+ }
+
+ public DouyinMicroAppClient Build()
+ {
+ DouyinMicroAppClient client = _disposeClient.HasValue
+ ? new DouyinMicroAppClient(_options, _httpClient, _disposeClient.Value)
+ : new DouyinMicroAppClient(_options, _httpClient);
+
+ foreach (Action configure in _configures)
+ {
+ client.Configure(configure);
+ }
+
+ foreach (HttpInterceptor interceptor in _interceptors)
+ {
+ client.Interceptors.Add(interceptor);
+ }
+
+ return client;
+ }
+ }
+
+ partial class DouyinMicroAppClientBuilder
+ {
+ public static DouyinMicroAppClientBuilder Create(DouyinMicroAppClientOptions options)
+ {
+ if (options is null) throw new ArgumentNullException(nameof(options));
+
+ return new DouyinMicroAppClientBuilder(options);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppClientOptions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppClientOptions.cs
new file mode 100644
index 00000000..b9366aac
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppClientOptions.cs
@@ -0,0 +1,51 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
+{
+ ///
+ /// 一个用于构造 时使用的配置项。
+ ///
+ public class DouyinMicroAppClientOptions
+ {
+ ///
+ /// 获取或设置请求超时时间(单位:毫秒)。
+ /// 默认值:30000
+ ///
+ public int Timeout { get; set; } = 30 * 1000;
+
+ ///
+ /// 获取或设置抖音小程序 API 入口点。
+ /// 默认值:
+ ///
+ public string Endpoint { get; set; } = DouyinMicroAppEndpoints.DEFAULT;
+
+ ///
+ /// 获取或设置抖音小程序旧版 API 入口点。
+ /// 默认值:
+ ///
+ public string EndpointForLegacy { get; set; } = DouyinMicroAppEndpoints.LEGACY_DEFAULT;
+
+ ///
+ /// 获取或设置抖音小程序 AppId。
+ ///
+ public string AppId { get; set; } = default!;
+
+ ///
+ /// 获取或设置抖音小程序 AppSecret。
+ ///
+ public string AppSecret { get; set; } = default!;
+
+ ///
+ /// 获取或设置抖音服务器推送的 Token。
+ ///
+ public string? PushToken { get; set; }
+
+ ///
+ /// 获取或设置抖音服务器推送的 EncodingAESKey。
+ ///
+ public string? PushEncodingAESKey { get; set; }
+
+ ///
+ /// 获取或设置用于担保支付请求签名的密钥。
+ ///
+ public string? ECPaySalt { get; set; }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppEndpoints.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppEndpoints.cs
new file mode 100644
index 00000000..49ae3e76
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppEndpoints.cs
@@ -0,0 +1,23 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
+{
+ ///
+ /// 抖音小程序 API 接口域名。
+ ///
+ public static class DouyinMicroAppEndpoints
+ {
+ ///
+ /// 默认域名。
+ ///
+ public const string DEFAULT = "https://open.douyin.com/api";
+
+ ///
+ /// 旧版接口默认域名。
+ ///
+ public const string LEGACY_DEFAULT = "https://developer.toutiao.com/api";
+
+ ///
+ /// 旧版接口沙盒环境域名。
+ ///
+ public const string LEGACY_SANGBOX = "https://open-sandbox.douyin.com/api";
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppEvent.cs
new file mode 100644
index 00000000..68e69563
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppEvent.cs
@@ -0,0 +1,43 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
+{
+ ///
+ /// 表示抖音小程序 API 消息推送事件的基类。
+ ///
+ [Newtonsoft.Json.JsonObject]
+ [System.Xml.Serialization.XmlRoot("xml")]
+ public class DouyinMicroAppEvent : ICommonWebhookEvent
+ {
+ ///
+ /// 获取或设置消息接收方账号。
+ ///
+ [Newtonsoft.Json.JsonProperty("ToUserName")]
+ [System.Text.Json.Serialization.JsonPropertyName("ToUserName")]
+ [System.Xml.Serialization.XmlElement("ToUserName", IsNullable = true)]
+ public virtual string? ToUserName { get; set; }
+
+ ///
+ /// 获取或设置消息发送方账号。
+ ///
+ [Newtonsoft.Json.JsonProperty("FromUserName")]
+ [System.Text.Json.Serialization.JsonPropertyName("FromUserName")]
+ [System.Xml.Serialization.XmlElement("FromUserName", IsNullable = true)]
+ public virtual string? FromUserName { get; set; }
+
+ ///
+ /// 获取或设置消息类型。
+ ///
+ [Newtonsoft.Json.JsonProperty("MsgType")]
+ [System.Text.Json.Serialization.JsonPropertyName("MsgType")]
+ [System.Xml.Serialization.XmlElement("MsgType", IsNullable = true)]
+ public virtual string? MessageType { get; set; }
+
+ ///
+ /// 获取或设置消息创建时间戳。
+ ///
+ [Newtonsoft.Json.JsonProperty("CreateTime")]
+ [System.Text.Json.Serialization.JsonPropertyName("CreateTime")]
+ [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
+ [System.Xml.Serialization.XmlElement("CreateTime")]
+ public virtual long CreateTimestamp { get; set; }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppException.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppException.cs
new file mode 100644
index 00000000..52e39674
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppException.cs
@@ -0,0 +1,27 @@
+using System;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
+{
+ ///
+ /// 当调用抖音小程序 API 出错时引发的异常。
+ ///
+ public class DouyinMicroAppException : CommonException
+ {
+ ///
+ public DouyinMicroAppException()
+ {
+ }
+
+ ///
+ public DouyinMicroAppException(string message)
+ : base(message)
+ {
+ }
+
+ ///
+ public DouyinMicroAppException(string message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppRequest.cs
new file mode 100644
index 00000000..f7fe0b77
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppRequest.cs
@@ -0,0 +1,18 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
+{
+ ///
+ /// 抖音小程序 API 请求的基类。
+ ///
+ public abstract class DouyinMicroAppRequest : CommonRequestBase, ICommonRequest
+ {
+ ///
+ /// 获取或设置抖音小程序的 AccessToken/ClientToken/BusinessToken。
+ ///
+ /// 注意:部分第三方平台的接口中该字段表示授权方的 AuthorizerAccessToken。
+ ///
+ ///
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
+ public virtual string? AccessToken { get; set; }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppResponse.cs
new file mode 100644
index 00000000..77e6c9ed
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/DouyinMicroAppResponse.cs
@@ -0,0 +1,49 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
+{
+ ///
+ /// 抖音小程序 API 响应的基类。
+ ///
+ public abstract class DouyinMicroAppResponse : CommonResponseBase, ICommonResponse
+ {
+ ///
+ /// 获取抖音小程序 API 返回的错误号。
+ ///
+ [Newtonsoft.Json.JsonProperty("err_no")]
+ [System.Text.Json.Serialization.JsonPropertyName("err_no")]
+ public virtual int ErrorNumber { get; set; }
+
+ ///
+ /// 获取抖音小程序 API 返回的错误信息。
+ ///
+ [Newtonsoft.Json.JsonProperty("err_tips")]
+ [System.Text.Json.Serialization.JsonPropertyName("err_tips")]
+ public virtual string? ErrorTips { get; set; }
+
+ ///
+ /// 获取抖音小程序 API 返回的错误描述。
+ ///
+ [Newtonsoft.Json.JsonProperty("err_msg")]
+ [System.Text.Json.Serialization.JsonPropertyName("err_msg")]
+ public virtual string? ErrorMessage { get; set; }
+
+ ///
+ /// 获取抖音小程序 API 返回的日志 ID。
+ ///
+ [Newtonsoft.Json.JsonProperty("log_id")]
+ [System.Text.Json.Serialization.JsonPropertyName("log_id")]
+ [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
+ public virtual string? LogId { get; set; }
+
+ ///
+ /// 获取一个值,该值指示调用抖音小程序 API 是否成功。
+ ///
+ ///(即 HTTP 状态码为 200,且 值为 0)
+ ///
+ ///
+ ///
+ public override bool IsSuccessful()
+ {
+ return GetRawStatus() == 200 && ErrorNumber == 0;
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Events/Message/ImageMessageEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Events/Message/ImageMessageEvent.cs
index dbdd380f..6edb1f52 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Events/Message/ImageMessageEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Events/Message/ImageMessageEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Events
{
///
/// 表示 image 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/component/message-push-customer-service
+ ///
+ /// REF:
+ ///
+ ///
///
- public class ImageMessageEvent : ByteDanceMicroAppEvent, ByteDanceMicroAppEvent.Serialization.IJsonSerializable, ByteDanceMicroAppEvent.Serialization.IXmlSerializable
+ public class ImageMessageEvent : DouyinMicroAppEvent
{
///
/// 获取或设置图片 URL。
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Events/Message/TextMessageEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Events/Message/TextMessageEvent.cs
index b5d4b833..65b3ecf1 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Events/Message/TextMessageEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Events/Message/TextMessageEvent.cs
@@ -2,9 +2,12 @@ namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Events
{
///
/// 表示 text 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/component/message-push-customer-service
+ ///
+ /// REF:
+ ///
+ ///
///
- public class TextMessageEvent : ByteDanceMicroAppEvent, ByteDanceMicroAppEvent.Serialization.IJsonSerializable, ByteDanceMicroAppEvent.Serialization.IXmlSerializable
+ public class TextMessageEvent : DouyinMicroAppEvent
{
///
/// 获取或设置消息内容。
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Exceptions/ByteDanceMicroAppEventSerializationException.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Exceptions/ByteDanceMicroAppEventSerializationException.cs
deleted file mode 100644
index 64cf1da3..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Exceptions/ByteDanceMicroAppEventSerializationException.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Exceptions
-{
- public class ByteDanceMicroAppEventSerializationException : ByteDanceMicroAppException
- {
- ///
- internal ByteDanceMicroAppEventSerializationException()
- {
- }
-
- ///
- internal ByteDanceMicroAppEventSerializationException(string message)
- : base(message)
- {
- }
-
- ///
- internal ByteDanceMicroAppEventSerializationException(string message, Exception innerException)
- : base(message, innerException)
- {
- }
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Exceptions/ByteDanceMicroAppRequestTimeoutException.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Exceptions/ByteDanceMicroAppRequestTimeoutException.cs
deleted file mode 100644
index cda3e0e6..00000000
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Exceptions/ByteDanceMicroAppRequestTimeoutException.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Exceptions
-{
- public class ByteDanceMicroAppRequestTimeoutException : ByteDanceMicroAppException
- {
- ///
- internal ByteDanceMicroAppRequestTimeoutException()
- {
- }
-
- ///
- internal ByteDanceMicroAppRequestTimeoutException(string message)
- : base(message)
- {
- }
-
- ///
- internal ByteDanceMicroAppRequestTimeoutException(string message, Exception innerException)
- : base(message, innerException)
- {
- }
- }
-}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiClient.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiClient.cs
new file mode 100644
index 00000000..8db0f802
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiClient.cs
@@ -0,0 +1,108 @@
+using System;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ ///
+ /// 一个抖音小程序服务商平台 API HTTP 客户端。
+ ///
+ public class DouyinMicroAppOpenApiClient : CommonClientBase, ICommonClient
+ {
+ public readonly string _BASEURL_LEGACY;
+
+ ///
+ /// 获取当前客户端使用的抖音小程序凭证。
+ ///
+ public Settings.Credentials Credentials { get; }
+
+ ///
+ /// 用指定的配置项初始化 类的新实例。
+ ///
+ /// 配置项。
+ public DouyinMicroAppOpenApiClient(DouyinMicroAppOpenApiClientOptions options)
+ : this(options, null)
+ {
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ internal protected DouyinMicroAppOpenApiClient(DouyinMicroAppOpenApiClientOptions options, HttpClient? httpClient, bool disposeClient = true)
+ : base(httpClient, disposeClient)
+ {
+ if (options is null) throw new ArgumentNullException(nameof(options));
+
+ Credentials = new Settings.Credentials(options);
+
+ FlurlClient.BaseUrl = options.Endpoints ?? DouyinMicroAppOpenApiEndpoints.DEFAULT;
+ FlurlClient.WithTimeout(options.Timeout <= 0 ? Timeout.InfiniteTimeSpan : TimeSpan.FromMilliseconds(options.Timeout));
+
+ _BASEURL_LEGACY = options.EndpointForLegacy ?? DouyinMicroAppEndpoints.LEGACY_DEFAULT;
+ }
+
+ ///
+ /// 使用当前客户端生成一个新的 对象。
+ ///
+ ///
+ ///
+ ///
+ ///
+ public IFlurlRequest CreateFlurlRequest(DouyinMicroAppOpenApiRequest request, HttpMethod httpMethod, params object[] urlSegments)
+ {
+ IFlurlRequest flurlRequest = base.CreateFlurlRequest(request, httpMethod, urlSegments);
+
+ if (request.ComponentAppId is null)
+ {
+ request.ComponentAppId = Credentials.ComponentAppId;
+ }
+
+ return flurlRequest;
+ }
+
+ ///
+ /// 异步发起请求。
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public async Task SendFlurlRequestAsync(IFlurlRequest flurlRequest, HttpContent? httpContent = null, CancellationToken cancellationToken = default)
+ where T : DouyinMicroAppOpenApiResponse, new()
+ {
+ if (flurlRequest is null) throw new ArgumentNullException(nameof(flurlRequest));
+
+ using IFlurlResponse flurlResponse = await base.SendFlurlRequestAsync(flurlRequest, httpContent, cancellationToken).ConfigureAwait(false);
+ return await WrapFlurlResponseAsJsonAsync(flurlResponse, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步发起请求。
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public async Task SendFlurlRequestAsJsonAsync(IFlurlRequest flurlRequest, object? data = null, CancellationToken cancellationToken = default)
+ where T : DouyinMicroAppOpenApiResponse, new()
+ {
+ if (flurlRequest is null) throw new ArgumentNullException(nameof(flurlRequest));
+
+ bool isSimpleRequest = data is null ||
+ flurlRequest.Verb == HttpMethod.Get ||
+ flurlRequest.Verb == HttpMethod.Head ||
+ flurlRequest.Verb == HttpMethod.Options;
+ using IFlurlResponse flurlResponse = isSimpleRequest ?
+ await base.SendFlurlRequestAsync(flurlRequest, null, cancellationToken) :
+ await base.SendFlurlRequestAsJsonAsync(flurlRequest, data, cancellationToken).ConfigureAwait(false);
+ return await WrapFlurlResponseAsJsonAsync(flurlResponse, cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiClientBuilder.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiClientBuilder.cs
new file mode 100644
index 00000000..b4bce120
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiClientBuilder.cs
@@ -0,0 +1,94 @@
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ ///
+ /// 用于构造 实例的构造器。
+ ///
+ public partial class DouyinMicroAppOpenApiClientBuilder : ICommonClientBuilder
+ {
+ private readonly DouyinMicroAppOpenApiClientOptions _options;
+ private readonly IList> _configures;
+ private readonly IList _interceptors;
+ private HttpClient? _httpClient;
+ private bool? _disposeClient;
+
+ private DouyinMicroAppOpenApiClientBuilder(DouyinMicroAppOpenApiClientOptions options)
+ {
+ _options = options;
+ _configures = new List>();
+ _interceptors = new List();
+ }
+
+ ICommonClientBuilder ICommonClientBuilder.ConfigureSettings(Action configure)
+ {
+ return ConfigureSettings(configure);
+ }
+
+ ICommonClientBuilder ICommonClientBuilder.UseInterceptor(HttpInterceptor interceptor)
+ {
+ return UseInterceptor(interceptor);
+ }
+
+ ICommonClientBuilder ICommonClientBuilder.UseHttpClient(HttpClient httpClient, bool disposeClient)
+ {
+ return UseHttpClient(httpClient, disposeClient);
+ }
+
+ public DouyinMicroAppOpenApiClientBuilder ConfigureSettings(Action configure)
+ {
+ if (configure is null) throw new ArgumentNullException(nameof(configure));
+
+ _configures.Add(configure);
+ return this;
+ }
+
+ public DouyinMicroAppOpenApiClientBuilder UseInterceptor(HttpInterceptor interceptor)
+ {
+ if (interceptor is null) throw new ArgumentNullException(nameof(interceptor));
+
+ _interceptors.Add(interceptor);
+ return this;
+ }
+
+ public DouyinMicroAppOpenApiClientBuilder UseHttpClient(HttpClient httpClient, bool disposeClient = true)
+ {
+ if (httpClient is null) throw new ArgumentNullException(nameof(httpClient));
+
+ _httpClient = httpClient;
+ _disposeClient = disposeClient;
+ return this;
+ }
+
+ public DouyinMicroAppOpenApiClient Build()
+ {
+ DouyinMicroAppOpenApiClient client = _disposeClient.HasValue
+ ? new DouyinMicroAppOpenApiClient(_options, _httpClient, _disposeClient.Value)
+ : new DouyinMicroAppOpenApiClient(_options, _httpClient);
+
+ foreach (Action configure in _configures)
+ {
+ client.Configure(configure);
+ }
+
+ foreach (HttpInterceptor interceptor in _interceptors)
+ {
+ client.Interceptors.Add(interceptor);
+ }
+
+ return client;
+ }
+ }
+
+ partial class DouyinMicroAppOpenApiClientBuilder
+ {
+ public static DouyinMicroAppOpenApiClientBuilder Create(DouyinMicroAppOpenApiClientOptions options)
+ {
+ if (options is null) throw new ArgumentNullException(nameof(options));
+
+ return new DouyinMicroAppOpenApiClientBuilder(options);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiClientOptions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiClientOptions.cs
new file mode 100644
index 00000000..264d36a4
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiClientOptions.cs
@@ -0,0 +1,46 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ ///
+ /// 一个用于构造 时使用的配置项。
+ ///
+ public class DouyinMicroAppOpenApiClientOptions
+ {
+ ///
+ /// 获取或设置请求超时时间(单位:毫秒)。
+ /// 默认值:30000
+ ///
+ public int Timeout { get; set; } = 30 * 1000;
+
+ ///
+ /// 获取或设置抖音小程序服务商平台 API 入口点。
+ /// 默认值:
+ ///
+ public string Endpoints { get; set; } = DouyinMicroAppOpenApiEndpoints.DEFAULT;
+
+ ///
+ /// 获取或设置抖音小程序服务商平台旧版 API 入口点。
+ /// 默认值:
+ ///
+ public string EndpointForLegacy { get; set; } = DouyinMicroAppOpenApiEndpoints.LEGACY_DEFAULT;
+
+ ///
+ /// 获取或设置抖音小程序服务商 AppId。
+ ///
+ public string ComponentAppId { get; set; } = default!;
+
+ ///
+ /// 获取或设置抖音小程序服务商 AppSecret。
+ ///
+ public string ComponentAppSecret { get; set; } = default!;
+
+ ///
+ /// 获取或设置头条服务器推送的 Token。
+ ///
+ public string? PushToken { get; set; }
+
+ ///
+ /// 获取或设置头条服务器推送的 EncodingAESKey。
+ ///
+ public string? PushEncodingAESKey { get; set; }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiEndpoints.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiEndpoints.cs
new file mode 100644
index 00000000..19f53ccf
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiEndpoints.cs
@@ -0,0 +1,18 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ ///
+ /// 抖音小程序服务商平台 API 接口域名。
+ ///
+ public static class DouyinMicroAppOpenApiEndpoints
+ {
+ ///
+ /// 默认域名。
+ ///
+ public const string DEFAULT = "https://open.douyin.com/api";
+
+ ///
+ /// 旧版接口服务商平台接口域名。
+ ///
+ public const string LEGACY_DEFAULT = "https://open.microapp.bytedance.com/openapi";
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiEvent.cs
new file mode 100644
index 00000000..dd4b4cf3
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiEvent.cs
@@ -0,0 +1,41 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ ///
+ /// 表示抖音小程序服务商平台 API 消息推送事件的基类。
+ ///
+ public class DouyinMicroAppOpenApiEvent : ICommonWebhookEvent
+ {
+ ///
+ /// 获取或设置第三方平台 AppId。
+ ///
+ [Newtonsoft.Json.JsonProperty("TpAppId")]
+ [System.Text.Json.Serialization.JsonPropertyName("TpAppId")]
+ [System.Xml.Serialization.XmlElement("TpAppId", IsNullable = true)]
+ public virtual string? ComponentAppId { get; set; }
+
+ ///
+ /// 获取或设置授权方 AppId。
+ ///
+ [Newtonsoft.Json.JsonProperty("AppId")]
+ [System.Text.Json.Serialization.JsonPropertyName("AppId")]
+ [System.Xml.Serialization.XmlElement("AppId", IsNullable = true)]
+ public virtual string? AuthorizerAppId { get; set; }
+
+ ///
+ /// 获取或设置事件类型。
+ ///
+ [Newtonsoft.Json.JsonProperty("Event")]
+ [System.Text.Json.Serialization.JsonPropertyName("Event")]
+ [System.Xml.Serialization.XmlElement("Event", IsNullable = true)]
+ public virtual string? Event { get; set; }
+
+ ///
+ /// 获取或设置事件产生时间字符串(格式:yyyy-MM-dd HH:mm:ss)。
+ ///
+ [Newtonsoft.Json.JsonProperty("EventTime")]
+ [System.Text.Json.Serialization.JsonPropertyName("EventTime")]
+ [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
+ [System.Xml.Serialization.XmlElement("EventTime", IsNullable = true)]
+ public virtual string? EventTimeString { get; set; }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiRequest.cs
new file mode 100644
index 00000000..759d34d1
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiRequest.cs
@@ -0,0 +1,38 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ ///
+ /// 抖音小程序服务商平台 API 请求的基类。
+ ///
+ public abstract class DouyinMicroAppOpenApiRequest : CommonRequestBase, ICommonRequest
+ {
+ ///
+ /// 获取或设置抖音小程序第三方 AppId。如果不指定将使用构造 时的 参数。
+ ///
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
+ public virtual string? ComponentAppId { get; set; }
+
+ ///
+ /// 获取或设置抖音小程序第三方的 AccessToken。
+ /// 注意:v1、v2 版的 ComponentAccessToken 不可混用。
+ ///
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
+ public virtual string? ComponentAccessToken { get; set; }
+
+ ///
+ /// 获取或设置抖音小程序授权方 AppId。
+ ///
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
+ public virtual string? AuthorizerAppId { get; set; }
+
+ ///
+ /// 获取或设置抖音小程序授权方的 AccessToken。
+ /// 注意:v1、v2 版的 AuthorizerAccessToken 不可混用。
+ ///
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
+ public virtual string? AuthorizerAccessToken { get; set; }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiResponse.cs
new file mode 100644
index 00000000..6fde12df
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/DouyinMicroAppOpenApiResponse.cs
@@ -0,0 +1,42 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ ///
+ /// 抖音小程序服务商平台 API 响应的基类。
+ ///
+ public abstract class DouyinMicroAppOpenApiResponse : CommonResponseBase, ICommonResponse
+ {
+ ///
+ /// 获取抖音小程序 API 返回的错误码。
+ ///
+ [Newtonsoft.Json.JsonProperty("err_no")]
+ [System.Text.Json.Serialization.JsonPropertyName("err_no")]
+ public virtual int ErrorNumber { get; set; }
+
+ ///
+ /// 获取抖音小程序 API 返回的错误描述。
+ ///
+ [Newtonsoft.Json.JsonProperty("err_msg")]
+ [System.Text.Json.Serialization.JsonPropertyName("err_msg")]
+ public virtual string? ErrorMessage { get; set; }
+
+ ///
+ /// 获取抖音小程序 API 返回的日志 ID。
+ ///
+ [Newtonsoft.Json.JsonProperty("log_id")]
+ [System.Text.Json.Serialization.JsonPropertyName("log_id")]
+ [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
+ public virtual string? LogId { get; set; }
+
+ ///
+ /// 获取一个值,该值指示调用抖音小程序 API 是否成功。
+ ///
+ ///(即 HTTP 状态码为 200,且 值为 0)
+ ///
+ ///
+ ///
+ public override bool IsSuccessful()
+ {
+ return GetRawStatus() == 200 && ErrorNumber == 0;
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/Auth/ComponentAuthorizedEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentAuthorizedEvent.cs
similarity index 83%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/Auth/ComponentAuthorizedEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentAuthorizedEvent.cs
index 0715de82..e70e5e66 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/Auth/ComponentAuthorizedEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentAuthorizedEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.AUTHORIZED 事件的数据。
- /// REF: https://partner.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/authorization/notify
+ ///
+ /// REF:
+ ///
+ ///
///
- public class ComponentAuthorizedEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ComponentAuthorizedEvent : DouyinMicroAppOpenApiEvent
{
///
/// 获取或设置授权码。
@@ -12,7 +15,7 @@ public class ComponentAuthorizedEvent : ByteDanceMicroAppOpenApiEvent, ByteDance
[Newtonsoft.Json.JsonProperty("AuthorizationCode")]
[System.Text.Json.Serialization.JsonPropertyName("AuthorizationCode")]
[System.Xml.Serialization.XmlElement("AuthorizationCode")]
- public string AuthCode { get; set; } = default!;
+ public string AuthorizationCode { get; set; } = default!;
///
/// 获取或设置授权码有效期(单位:秒)。
@@ -20,7 +23,7 @@ public class ComponentAuthorizedEvent : ByteDanceMicroAppOpenApiEvent, ByteDance
[Newtonsoft.Json.JsonProperty("AuthorizationCodeExpiresIn")]
[System.Text.Json.Serialization.JsonPropertyName("AuthorizationCodeExpiresIn")]
[System.Xml.Serialization.XmlElement("AuthorizationCodeExpiresIn")]
- public long AuthCodeExpiresIn { get; set; }
+ public long AuthorizationCodeExpiresIn { get; set; }
///
/// 获取或设置代创建的小程序名称。
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/Auth/ComponentPushTicketEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentPushTicketEvent.cs
similarity index 78%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/Auth/ComponentPushTicketEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentPushTicketEvent.cs
index df6e86f8..1df06dc4 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/Auth/ComponentPushTicketEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentPushTicketEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 PUSH.Ticket 事件的数据。
- /// REF: https://partner.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/authorization/componentticket
+ ///
+ /// REF:
+ ///
+ ///
///
- public class ComponentPushTicketEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ComponentPushTicketEvent : DouyinMicroAppOpenApiEvent
{
///
/// 获取或设置消息发送方账号。
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentUnauthorizedEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentUnauthorizedEvent.cs
new file mode 100644
index 00000000..61fe2ab8
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentUnauthorizedEvent.cs
@@ -0,0 +1,13 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
+{
+ ///
+ /// 表示 EVENT.UNAUTHORIZED 事件的数据。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ public class ComponentUnauthorizedEvent : DouyinMicroAppOpenApiEvent
+ {
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentUpdateAuthorizedEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentUpdateAuthorizedEvent.cs
new file mode 100644
index 00000000..d1e180f8
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/Auth/ComponentUpdateAuthorizedEvent.cs
@@ -0,0 +1,28 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
+{
+ ///
+ /// 表示 EVENT.UPDATE_AUTHORIZED 事件的数据。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ public class ComponentUpdateAuthorizedEvent : DouyinMicroAppOpenApiEvent
+ {
+ ///
+ /// 获取或设置授权码。
+ ///
+ [Newtonsoft.Json.JsonProperty("AuthorizationCode")]
+ [System.Text.Json.Serialization.JsonPropertyName("AuthorizationCode")]
+ [System.Xml.Serialization.XmlElement("AuthorizationCode")]
+ public string AuthorizationCode { get; set; } = default!;
+
+ ///
+ /// 获取或设置授权码有效期(单位:秒)。
+ ///
+ [Newtonsoft.Json.JsonProperty("AuthorizationCodeExpiresIn")]
+ [System.Text.Json.Serialization.JsonPropertyName("AuthorizationCodeExpiresIn")]
+ [System.Xml.Serialization.XmlElement("AuthorizationCodeExpiresIn")]
+ public long AuthorizationCodeExpiresIn { get; set; }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/AppNameResetEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/AppNameResetEvent.cs
new file mode 100644
index 00000000..f09b440d
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/AppNameResetEvent.cs
@@ -0,0 +1,20 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
+{
+ ///
+ /// 表示 EVENT.APP_NAME_RESET_NOTIFICATION 事件的数据。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ public class AppNameResetEvent : DouyinMicroAppOpenApiEvent
+ {
+ ///
+ /// 获取或设置名称重置通知。
+ ///
+ [Newtonsoft.Json.JsonProperty("AppNameResetNotification")]
+ [System.Text.Json.Serialization.JsonPropertyName("AppNameResetNotification")]
+ [System.Xml.Serialization.XmlElement("AppNameResetNotification")]
+ public string AppNameResetNotification { get; set; } = default!;
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppCategoryEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppCategoryEvent.cs
similarity index 80%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppCategoryEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppCategoryEvent.cs
index ac4c8903..07946cba 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppCategoryEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppCategoryEvent.cs
@@ -1,11 +1,14 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.MODIFY_APP_CATEGORY 事件的数据。
- /// REF: https://partner.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/base-info/add-category
- /// REF: https://partner.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/base-info/supply-category
+ ///
+ /// REF:
+ ///
+ ///
+ ///
///
- public class ModifyAppCategoryEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ModifyAppCategoryEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppIconEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppIconEvent.cs
similarity index 77%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppIconEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppIconEvent.cs
index 4f97e5bc..f5caa00f 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppIconEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppIconEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.MODIFY_APP_ICON 事件的数据。
- /// REF: https://partner.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/base-info/modify-icon
+ ///
+ /// REF:
+ ///
+ ///
///
- public class ModifyAppIconEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ModifyAppIconEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppIntroductionEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppIntroductionEvent.cs
similarity index 76%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppIntroductionEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppIntroductionEvent.cs
index c9acc349..559eb635 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppIntroductionEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppIntroductionEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.MODIFY_APP_INTRO 事件的数据。
- /// REF: https://partner.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/base-info/modify-intro
+ ///
+ /// REF:
+ ///
+ ///
///
- public class ModifyAppIntroductionEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ModifyAppIntroductionEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppNameEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppNameEvent.cs
similarity index 81%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppNameEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppNameEvent.cs
index ce4eaffd..50aa2479 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/ModifyAppNameEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/ModifyAppNameEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.MODIFY_APP_NAME 事件的数据。
- /// REF: https://partner.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/base-info/modify-name
+ ///
+ /// REF:
+ ///
+ ///
///
- public class ModifyAppNameEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ModifyAppNameEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/PackageAuditEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/PackageAuditEvent.cs
similarity index 92%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/PackageAuditEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/PackageAuditEvent.cs
index c6004401..939ee49b 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppManagement/PackageAuditEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppManagement/PackageAuditEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.PACKAGE_AUDIT 事件的数据。
- /// REF: https://partner.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/develop/audit-code
+ ///
+ /// REF:
+ ///
+ ///
///
- public class PackageAuditEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class PackageAuditEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/AliasAuditResultEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/AliasAuditResultEvent.cs
similarity index 80%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/AliasAuditResultEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/AliasAuditResultEvent.cs
index f691266d..49080198 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/AliasAuditResultEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/AliasAuditResultEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.ALIAS_AUDIT_RESULT 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/microapp/alias-search-tag
+ ///
+ /// REF:
+ ///
+ ///
///
- public class AliasAuditResultEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class AliasAuditResultEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyCapabilityEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyCapabilityEvent.cs
new file mode 100644
index 00000000..0bbee4b1
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyCapabilityEvent.cs
@@ -0,0 +1,55 @@
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
+{
+ ///
+ /// 表示 EVENT.APPLY_CAPACITY 事件的数据。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public class ApplyCapabilityEvent : DouyinMicroAppOpenApiEvent
+ {
+ public static class Types
+ {
+ public class EventContent
+ {
+ ///
+ /// 获取或设置挂载能力标识。
+ ///
+ [Newtonsoft.Json.JsonProperty("capacity_key")]
+ [System.Text.Json.Serialization.JsonPropertyName("capacity_key")]
+ [System.Xml.Serialization.XmlElement("capacity_key")]
+ public string CapacityKey { get; set; } = default!;
+
+ ///
+ /// 获取或设置审核结果。
+ ///
+ [Newtonsoft.Json.JsonProperty("status")]
+ [System.Text.Json.Serialization.JsonPropertyName("status")]
+ [System.Xml.Serialization.XmlElement("status")]
+ public int Status { get; set; }
+
+ ///
+ /// 获取或设置审核拒绝原因。
+ ///
+ [Newtonsoft.Json.JsonProperty("reason")]
+ [System.Text.Json.Serialization.JsonPropertyName("reason")]
+ [System.Xml.Serialization.XmlElement("reason", IsNullable = true)]
+ public string? RejectReason { get; set; }
+ }
+ }
+
+ ///
+ /// 获取或设置事件内容。
+ ///
+ [Newtonsoft.Json.JsonProperty("EventContent")]
+ [System.Text.Json.Serialization.JsonPropertyName("EventContent")]
+ [System.Xml.Serialization.XmlElement("EventContent")]
+ public Types.EventContent EventContent { get; set; } = default!;
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyLiveCapabilityEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyLiveCapabilityEvent.cs
similarity index 76%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyLiveCapabilityEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyLiveCapabilityEvent.cs
index 848ff52a..b7eda5d1 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyLiveCapabilityEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyLiveCapabilityEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.APPLY_LIVE_CAPABILITY 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/microapp/live-application
+ ///
+ /// REF:
+ ///
+ ///
///
- public class ApplyLiveCapabilityEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ApplyLiveCapabilityEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyPhoneNumberCapabilityEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyPhoneNumberCapabilityEvent.cs
similarity index 76%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyPhoneNumberCapabilityEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyPhoneNumberCapabilityEvent.cs
index 8330d110..0759e388 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyPhoneNumberCapabilityEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyPhoneNumberCapabilityEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.APPLY_PHONE_NUMBER_CAPABILITY 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/microapp/phone-number-application
+ ///
+ /// REF:
+ ///
+ ///
///
- public class ApplyPhoneNumberCapabilityEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ApplyPhoneNumberCapabilityEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyShareTemplateEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyShareTemplateEvent.cs
similarity index 75%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyShareTemplateEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyShareTemplateEvent.cs
index a48ba10b..1068d404 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyShareTemplateEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyShareTemplateEvent.cs
@@ -1,11 +1,14 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.APPLY_SHARE_TEMPLATE 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/microapp/addShareTpl
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/microapp/modifyShareTpl
+ ///
+ /// REF:
+ ///
+ ///
+ ///
///
- public class ApplyShareTemplateEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ApplyShareTemplateEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyVideoCapabilityEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyVideoCapabilityEvent.cs
similarity index 76%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyVideoCapabilityEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyVideoCapabilityEvent.cs
index 3a97d483..1ca404c6 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ApplyVideoCapabilityEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ApplyVideoCapabilityEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.APPLY_VIDEO_CAPABILITY 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/microapp/video-application
+ ///
+ /// REF:
+ ///
+ ///
///
- public class ApplyVideoCapabilityEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ApplyVideoCapabilityEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/AwemePermissionAuditResultEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/AwemePermissionAuditResultEvent.cs
similarity index 81%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/AwemePermissionAuditResultEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/AwemePermissionAuditResultEvent.cs
index c61e93f9..3d4511ed 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/AwemePermissionAuditResultEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/AwemePermissionAuditResultEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.AWEME_PERMISSION_AUDIT_RESULT 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/all/douyin
+ ///
+ /// REF:
+ ///
+ ///
///
- public class AwemePermissionAuditResultEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class AwemePermissionAuditResultEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/AwemeVideoKeywordAuditResultEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/AwemeVideoKeywordAuditResultEvent.cs
similarity index 80%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/AwemeVideoKeywordAuditResultEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/AwemeVideoKeywordAuditResultEvent.cs
index c9ef8ded..f8bcc588 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/AwemeVideoKeywordAuditResultEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/AwemeVideoKeywordAuditResultEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.AWEME_VIDEO_KEYWORD_AUDIT_RESULT 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/all/aweme-video-keyword
+ ///
+ /// REF:
+ ///
+ ///
///
- public class AwemeVideoKeywordAuditResultEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class AwemeVideoKeywordAuditResultEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/BindAwemeUserEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/BindAwemeUserEvent.cs
similarity index 83%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/BindAwemeUserEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/BindAwemeUserEvent.cs
index 19016557..d9a2db8d 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/BindAwemeUserEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/BindAwemeUserEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.BIND_AWEME_USER 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/microapp/follow-aweme
+ ///
+ /// REF:
+ ///
+ ///
///
- public class BindAwemeUserEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class BindAwemeUserEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/CreateSubscribeNotificationTemplateResultEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/CreateSubscribeNotificationTemplateResultEvent.cs
similarity index 85%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/CreateSubscribeNotificationTemplateResultEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/CreateSubscribeNotificationTemplateResultEvent.cs
index 860fcfbd..354783db 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/CreateSubscribeNotificationTemplateResultEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/CreateSubscribeNotificationTemplateResultEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.CREATE_SUBSCRIBE_NOTIFICATION_TEMPLATE_RESULT 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/microapp/subscribe-notification-template
+ ///
+ /// REF:
+ ///
+ ///
///
- public class CreateSubscribeNotificationTemplateResultEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class CreateSubscribeNotificationTemplateResultEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ScopeQuotaAuditResultEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ScopeQuotaAuditResultEvent.cs
similarity index 87%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ScopeQuotaAuditResultEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ScopeQuotaAuditResultEvent.cs
index 8865289b..6fde3687 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/ScopeQuotaAuditResultEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/ScopeQuotaAuditResultEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.SCOPE_QUOTA_AUDIT_RESULT 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/all/scope-quota
+ ///
+ /// REF:
+ ///
+ ///
///
- public class ScopeQuotaAuditResultEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class ScopeQuotaAuditResultEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/SearchTagAuditResultEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/SearchTagAuditResultEvent.cs
similarity index 80%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/SearchTagAuditResultEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/SearchTagAuditResultEvent.cs
index 2d09b250..7dac167c 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/SearchTagAuditResultEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/SearchTagAuditResultEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.SEARCH_TAG_AUDIT_RESULT 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/microapp/alias-search-tag
+ ///
+ /// REF:
+ ///
+ ///
///
- public class SearchTagAuditResultEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class SearchTagAuditResultEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/SelfMountBindEvent.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/SelfMountBindEvent.cs
similarity index 83%
rename from src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/SelfMountBindEvent.cs
rename to src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/SelfMountBindEvent.cs
index 0771083d..20737026 100644
--- a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/SDK/OpenApi/Events/MicroAppOperation/SelfMountBindEvent.cs
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Events/MicroAppOperation/SelfMountBindEvent.cs
@@ -1,10 +1,13 @@
-namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.SDK.OpenApi.Events
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Events
{
///
/// 表示 EVENT.SELT_MOUNT_BIND 事件的数据。
- /// REF: https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/auth-app-manage/operation/microapp/self-mount
+ ///
+ /// REF:
+ ///
+ ///
///
- public class SelfMountBindEvent : ByteDanceMicroAppOpenApiEvent, ByteDanceMicroAppOpenApiEvent.Serialization.IJsonSerializable, ByteDanceMicroAppOpenApiEvent.Serialization.IXmlSerializable
+ public class SelfMountBindEvent : DouyinMicroAppOpenApiEvent
{
public static class Types
{
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientEventExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientEventExtensions.cs
new file mode 100644
index 00000000..1cf24b9a
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientEventExtensions.cs
@@ -0,0 +1,222 @@
+using System;
+using System.Xml.Linq;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ using SKIT.FlurlHttpClient.Primitives;
+
+ ///
+ /// 为 提供回调通知事件的扩展方法。
+ ///
+ public static partial class DouyinMicroAppOpenApiClientEventExtensions
+ {
+ ///
+ /// 从 JSON 反序列化得到 对象。
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static TEvent DeserializeEventFromJson(this DouyinMicroAppOpenApiClient client, string webhookJson)
+ where TEvent : DouyinMicroAppOpenApiEvent, new()
+ {
+ return InnerDeserializeEventFromJson(client, webhookJson);
+ }
+
+ ///
+ /// 从 JSON 反序列化得到 对象。
+ ///
+ ///
+ ///
+ ///
+ public static DouyinMicroAppOpenApiEvent DeserializeEventFromJson(this DouyinMicroAppOpenApiClient client, string webhookJson)
+ {
+ return InnerDeserializeEventFromJson(client, webhookJson);
+ }
+
+ ///
+ /// 从 XML 反序列化得到 对象。
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static TEvent DeserializeEventFromXml(this DouyinMicroAppOpenApiClient client, string webhookXml)
+ where TEvent : DouyinMicroAppOpenApiEvent, new()
+ {
+ return InnerDeserializeEventFromXml(client, webhookXml);
+ }
+
+ ///
+ /// 从 XML 反序列化得到 对象。
+ ///
+ ///
+ ///
+ ///
+ public static DouyinMicroAppOpenApiEvent DeserializeEventFromXml(this DouyinMicroAppOpenApiClient client, string webhookXml)
+ {
+ return InnerDeserializeEventFromXml(client, webhookXml);
+ }
+
+ ///
+ /// 验证回调通知事件签名。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static ErroredResult VerifyEventSignatureFromJson(this DouyinMicroAppOpenApiClient client, string webhookJson)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+
+ ErroredResult result;
+
+ try
+ {
+ InnerEncryptedEvent encryptedEvent = client.JsonSerializer.Deserialize(webhookJson);
+ bool valid = Utilities.DyMsgCryptor.VerifySignature(
+ sToken: client.Credentials.PushToken!,
+ sTimestamp: encryptedEvent.TimestampString,
+ sNonce: encryptedEvent.Nonce,
+ sMsgEncrypt: encryptedEvent.EncryptedData,
+ sMsgSign: encryptedEvent.Signature
+ );
+
+ if (valid)
+ result = ErroredResult.Ok();
+ else
+ result = ErroredResult.Fail(new Exception($"Signature does not match."));
+ }
+ catch (Exception ex)
+ {
+ result = ErroredResult.Fail(ex);
+ }
+
+ return result;
+ }
+
+ ///
+ /// 验证回调通知事件签名。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static ErroredResult VerifyEventSignatureFromXml(this DouyinMicroAppOpenApiClient client, string webhookXml)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+
+ ErroredResult result;
+
+ try
+ {
+ XDocument xdoc = XDocument.Parse(webhookXml);
+ bool valid = Utilities.DyMsgCryptor.VerifySignature(
+ sToken: client.Credentials.PushToken!,
+ sTimestamp: xdoc.Root!.Element("TimeStamp")!.Value,
+ sNonce: xdoc.Root!.Element("Nonce")!.Value,
+ sMsgEncrypt: xdoc.Root!.Element("Encrypt")!.Value,
+ sMsgSign: xdoc.Root!.Element("MsgSignature")!.Value
+ );
+
+ if (valid)
+ result = ErroredResult.Ok();
+ else
+ result = ErroredResult.Fail(new Exception($"Signature does not match."));
+ }
+ catch (Exception ex)
+ {
+ result = ErroredResult.Fail(ex);
+ }
+
+ return result;
+ }
+ }
+
+ partial class DouyinMicroAppOpenApiClientEventExtensions
+ {
+ private class InnerEncryptedEvent
+ {
+ [Newtonsoft.Json.JsonProperty("Encrypt")]
+ [System.Text.Json.Serialization.JsonPropertyName("Encrypt")]
+ [System.Xml.Serialization.XmlElement("Encrypt")]
+ public string EncryptedData { get; set; } = default!;
+
+ [Newtonsoft.Json.JsonProperty("TimeStamp")]
+ [System.Text.Json.Serialization.JsonPropertyName("TimeStamp")]
+ [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))]
+ [System.Xml.Serialization.XmlElement("TimeStamp")]
+ public string TimestampString { get; set; } = default!;
+
+ [Newtonsoft.Json.JsonProperty("Nonce")]
+ [System.Text.Json.Serialization.JsonPropertyName("Nonce")]
+ [System.Xml.Serialization.XmlElement("Nonce")]
+ public string Nonce { get; set; } = default!;
+
+ [Newtonsoft.Json.JsonProperty("MsgSignature")]
+ [System.Text.Json.Serialization.JsonPropertyName("MsgSignature")]
+ [System.Xml.Serialization.XmlElement("MsgSignature")]
+ public string Signature { get; set; } = default!;
+ }
+
+ private static TEvent InnerDeserializeEventFromJson(DouyinMicroAppOpenApiClient client, string webhookJson)
+ where TEvent : DouyinMicroAppOpenApiEvent
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (webhookJson is null) throw new ArgumentNullException(webhookJson);
+
+ try
+ {
+ if (webhookJson.Contains("\"Encrypt\""))
+ {
+ InnerEncryptedEvent encryptedEvent = client.JsonSerializer.Deserialize(webhookJson);
+ webhookJson = Utilities.DyMsgCryptor.AESDecrypt(cipherText: encryptedEvent.EncryptedData, encodingAESKey: client.Credentials.PushEncodingAESKey!, out _);
+ }
+
+ return client.JsonSerializer.Deserialize(webhookJson);
+ }
+ catch (DouyinMicroAppException)
+ {
+ throw;
+ }
+ catch (Exception ex)
+ {
+ throw new DouyinMicroAppException("Failed to deserialize event data. Please see the inner exception for more details.", ex);
+ }
+ }
+
+ private static TEvent InnerDeserializeEventFromXml(DouyinMicroAppOpenApiClient client, string webhookXml)
+ where TEvent : DouyinMicroAppOpenApiEvent
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (webhookXml is null) throw new ArgumentNullException(webhookXml);
+
+ try
+ {
+ if (webhookXml.Contains("") && webhookXml.Contains(""))
+ {
+ if (!Utilities.DyMsgCryptor.TryParseXml(webhookXml, out string encryptedXml))
+ throw new DouyinMicroAppException("Failed to decrypt event data, because the encrypted data is empty.");
+
+ webhookXml = Utilities.DyMsgCryptor.AESDecrypt(cipherText: encryptedXml, encodingAESKey: client.Credentials.PushEncodingAESKey!, out _);
+ }
+
+ return Utilities.XmlHelper.Deserialize(webhookXml);
+ }
+ catch (DouyinMicroAppException)
+ {
+ throw;
+ }
+ catch (Exception ex)
+ {
+ throw new DouyinMicroAppException("Failed to deserialize event data. Please see the inner exception for more details.", ex);
+ }
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsBasicInfoExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsBasicInfoExtensions.cs
new file mode 100644
index 00000000..72c3938d
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsBasicInfoExtensions.cs
@@ -0,0 +1,149 @@
+using System;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteAppsBasicInfoExtensions
+ {
+ ///
+ /// 异步调用 [GET] /apps/v2/basic_info/get_info 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsBasicInfoGetInfoV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsBasicInfoGetInfoV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v2", "basic_info", "get_info")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v2/basic_info/check_app_name 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsBasicInfoCheckAppNameV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsBasicInfoCheckAppNameV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v2", "basic_info", "check_app_name")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v2/basic_info/modify_app_name 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsBasicInfoModifyAppNameV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsBasicInfoModifyAppNameV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v2", "basic_info", "modify_app_name")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v2/basic_info/modify_app_intro 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsBasicInfoModifyAppIntroductionV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsBasicInfoModifyAppIntroductionV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v2", "basic_info", "modify_app_intro")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v2/basic_info/modify_app_icon 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsBasicInfoModifyAppIconV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsBasicInfoModifyAppIconV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v2", "basic_info", "modify_app_icon")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v2/basic_info/get_qr_code 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsBasicInfoGetQrcodeV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsBasicInfoGetQrcodeV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v2", "basic_info", "get_qr_code")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsCategoryExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsCategoryExtensions.cs
new file mode 100644
index 00000000..bfca97cc
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsCategoryExtensions.cs
@@ -0,0 +1,126 @@
+using System;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteAppsCategoryExtensions
+ {
+ ///
+ /// 异步调用 [GET] /apps/v1/category/get_all_categories 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsCategoryGetAllCategoriesV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsCategoryGetAllCategoriesV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "category", "get_all_categories")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/category/get_audit_categories 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsCategoryGetAuditCategoriesV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsCategoryGetAuditCategoriesV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "category", "get_audit_categories")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v1/category/add_categories 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsCategoryAddCategoriesV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsCategoryAddCategoriesV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "category", "add_categories")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v1/category/del_categories 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsCategoryDeleteCategoriesV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsCategoryDeleteCategoriesV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "category", "del_categories")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v1/category/supply_categories 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsCategorySupplyCategoriesV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsCategorySupplyCategoriesV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "category", "supply_categories")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsCreditScoreExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsCreditScoreExtensions.cs
new file mode 100644
index 00000000..d765ffc5
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsCreditScoreExtensions.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteAppsCreditScoreExtensions
+ {
+ ///
+ /// 异步调用 [GET] /apps/v2/credit_score/get_credit_score 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsCreditScoreGetCreditScoreV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsCreditScoreGetCreditScoreV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v2", "credit_score", "get_credit_score")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsDomainExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsDomainExtensions.cs
new file mode 100644
index 00000000..41f8363a
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsDomainExtensions.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteAppsDomainExtensions
+ {
+ ///
+ /// 异步调用 [POST] /apps/v2/domain/modify_server_domain 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsDomainModifyServerDomainV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsDomainModifyServerDomainV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v2", "domain", "modify_server_domain")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v2/domain/modify_webview_domain 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsDomainModifyWebviewDomainV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsDomainModifyWebviewDomainV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v2", "domain", "modify_webview_domain")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsFileExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsFileExtensions.cs
new file mode 100644
index 00000000..1ec16af2
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsFileExtensions.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Net.Http;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteAppsFileExtensions
+ {
+ ///
+ /// 异步调用 [POST] /apps/v2/file/upload_material 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsFileUploadMaterialV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsFileUploadMaterialV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ if (request.MaterialFileName is null)
+ request.MaterialFileName = Guid.NewGuid().ToString("N").ToLower() + (request.MaterialType == 8 ? ".pdf" : ".jpg");
+
+ if (request.MaterialFileContentType is null)
+ request.MaterialFileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForMaterial(request.MaterialFileName) ?? (request.MaterialType == 8 ? "application/pdf" : "image/jpeg");
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v2", "file", "upload_material")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ using var httpContent = Utilities.FileHttpContentBuilder.Build(fileName: request.MaterialFileName, fileBytes: request.MaterialFileBytes, fileContentType: request.MaterialFileContentType, formDataName: "material_file");
+ httpContent.Add(new ByteArrayContent(Encoding.UTF8.GetBytes(request.MaterialType.ToString())), "material_type");
+
+ return await client.SendFlurlRequestAsync(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsICPRecordExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsICPRecordExtensions.cs
new file mode 100644
index 00000000..480df29c
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsICPRecordExtensions.cs
@@ -0,0 +1,276 @@
+using System;
+using System.Net.Http;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteAppsICPRecordExtensions
+ {
+ ///
+ /// 异步调用 [POST] /apps/v1/icp_record/upload_image/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordUploadImageV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordUploadImageV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ if (request.ImageFileName is null)
+ request.ImageFileName = Guid.NewGuid().ToString("N").ToLower() + ".jpg";
+
+ if (request.ImageFileContentType is null)
+ request.ImageFileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForMaterial(request.ImageFileName) ?? "image/jpeg";
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "icp_record", "upload_image", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ using var httpContent = Utilities.FileHttpContentBuilder.Build(fileName: request.ImageFileName, fileBytes: request.ImageFileBytes, fileContentType: request.ImageFileContentType, formDataName: "image");
+ httpContent.Add(new ByteArrayContent(Encoding.UTF8.GetBytes(request.ImageType.ToString())), "image_type");
+
+ return await client.SendFlurlRequestAsync(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/icp_record/get_facial_recognition_url/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordGetFacialRecognitionUrlV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordGetFacialRecognitionUrlV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "icp_record", "get_facial_recognition_url", "")
+ .SetQueryParam("province_code", request.ProvinceCode)
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v1/icp_record/send_facial_recognition_notify/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordSendFacialRecognitionNotifyV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordSendFacialRecognitionNotifyV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "icp_record", "send_facial_recognition_notify", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/icp_record/query_facial_recognition_status/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordQueryFacialRecognitionStatusV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordQueryFacialRecognitionStatusV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "icp_record", "query_facial_recognition_status", "")
+ .SetQueryParam("facial_recognition_token", request.FacialRecognitionToken)
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/icp_record/query_corp_type_list/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordQueryCorpTypeListV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordQueryCorpTypeListV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "icp_record", "query_corp_type_list", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/icp_record/query_region_list/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordQueryRegionListV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordQueryRegionListV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "icp_record", "query_region_list", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/icp_record/query_incharge_people_credentials_type_list/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordQueryInchargePeopleCredentialsTypeListV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordQueryInchargePeopleCredentialsTypeListV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "icp_record", "query_incharge_people_credentials_type_list", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/icp_record/query_service_content_type_list/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordQueryServiceContentTypeListV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordQueryServiceContentTypeListV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "icp_record", "query_incharge_people_credentials_type_list", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/icp_record/query_pre_approval_item_type_list/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordQueryPreApprovalItemTypeListV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordQueryPreApprovalItemTypeListV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "icp_record", "query_pre_approval_item_type_list", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/icp_record/query_record_status/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordQueryRecordStatusV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordQueryRecordStatusV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "icp_record", "query_record_status", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v1/icp_record/submit_record_info/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsICPRecordSubmitRecordInfoV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsICPRecordSubmitRecordInfoV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "icp_record", "submit_record_info", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsPackageVersionExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsPackageVersionExtensions.cs
new file mode 100644
index 00000000..e0f98f5f
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsPackageVersionExtensions.cs
@@ -0,0 +1,172 @@
+using System;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteAppsPackageVersionExtensions
+ {
+ ///
+ /// 异步调用 [POST] /apps/v1/package_version/upload/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsPackageVersionUploadV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsPackageVersionUploadV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "package_version", "upload", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/package_version/get_audit_hosts/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsPackageVersionGetAuditHostsV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsPackageVersionGetAuditHostsV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "package_version", "get_audit_hosts", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v1/package_version/audit/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsPackageVersionAuditV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsPackageVersionAuditV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "package_version", "audit", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v1/package_version/revoke_audit/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsPackageVersionRevokeAuditV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsPackageVersionRevokeAuditV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "package_version", "revoke_audit", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v1/package_version/release/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsPackageVersionReleaseV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsPackageVersionReleaseV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "package_version", "release", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /apps/v1/package_version/rollback/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsPackageVersionRollbackV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsPackageVersionRollbackV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "apps", "v1", "package_version", "rollback", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /apps/v1/package_version/versions/ 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsPackageVersionGetVersionsV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsPackageVersionGetVersionsV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v1", "package_version", "versions", "")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsTrialExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsTrialExtensions.cs
new file mode 100644
index 00000000..90949bbb
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteAppsTrialExtensions.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteAppsTrialExtensions
+ {
+ ///
+ /// 异步调用 [GET] /apps/v2/trial/get_trial_info 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenAppsTrialGetTrialInfoV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenAppsTrialGetTrialInfoV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "apps", "v2", "trial", "get_trial_info")
+ .WithHeader("access-token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacyAuthExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacyAuthExtensions.cs
new file mode 100644
index 00000000..89726d8a
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacyAuthExtensions.cs
@@ -0,0 +1,146 @@
+using System;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteLegacyAuthExtensions
+ {
+ ///
+ /// 异步调用 [GET] /v1/oauth/token 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiOAuthTokenV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiOAuthTokenV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "oauth", "token")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "oauth", "token"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken)
+ .SetQueryParam("grant_type", request.GrantType)
+ .SetQueryParam("authorization_code", request.AuthorizationCode)
+ .SetQueryParam("authorizer_refresh_token", request.AuthorizerRefreshToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/auth/tp/token 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiAuthThirdPartyTokenV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiAuthThirdPartyTokenV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ if (request.ComponentAppSecret is null)
+ request.ComponentAppSecret = client.Credentials.ComponentAppSecret;
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "auth", "tp", "token")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "auth", "tp", "token"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_appsecret", request.ComponentAppSecret)
+ .SetQueryParam("component_ticket", request.ComponentTicket);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v2/auth/pre_auth_code 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiAuthPreAuthCodeV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiAuthPreAuthCodeV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v2", "auth", "pre_auth_code")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v2", "auth", "pre_auth_code"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v2/auth/gen_link 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiAuthGenerateLinkV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiAuthGenerateLinkV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v2", "auth", "gen_link")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v2", "auth", "gen_link"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/auth/retrieve 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiAuthRetrieveV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiAuthRetrieveV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "auth", "retrieve")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "auth", "retrieve"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken)
+ .SetQueryParam("authorization_appid", request.AuthorizerAppId);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacyMicroAppExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacyMicroAppExtensions.cs
new file mode 100644
index 00000000..1ed24a45
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacyMicroAppExtensions.cs
@@ -0,0 +1,982 @@
+using System;
+using System.Net.Http;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteLegacyMicroAppExtensions
+ {
+ ///
+ /// 异步调用 [GET] /v1/microapp/code2session 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppCode2SessionV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppCode2SessionV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "code2session")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "code2session"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken)
+ .SetQueryParam("code", request.Code)
+ .SetQueryParam("anonymous_code", request.AnoymousCode);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/upload_material 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppUploadMaterialV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppUploadMaterialV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ if (request.MaterialFileName is null)
+ request.MaterialFileName = Guid.NewGuid().ToString("N").ToLower() + (request.MaterialType == 8 ? ".pdf" : ".jpg");
+
+ if (request.MaterialFileContentType is null)
+ request.MaterialFileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForMaterial(request.MaterialFileName) ?? (request.MaterialType == 8 ? "application/pdf" : "image/jpeg");
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "upload_material")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "upload_material"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ using var httpContent = Utilities.FileHttpContentBuilder.Build(fileName: request.MaterialFileName, fileBytes: request.MaterialFileBytes, fileContentType: request.MaterialFileContentType, formDataName: "material_file");
+ httpContent.Add(new ByteArrayContent(Encoding.UTF8.GetBytes(request.MaterialType.ToString())), "material_type");
+
+ return await client.SendFlurlRequestAsync(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ #region App
+ ///
+ /// 异步调用 [GET] /v1/microapp/app/info 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppInfoV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppInfoV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "app", "info")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "info"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/app/qrcode 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppQrcodeV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppQrcodeV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "app", "qrcode")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "qrcode"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/app/check_app_name 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppCheckAppNameV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppCheckAppNameV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "app", "check_app_name")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "check_app_name"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken)
+ .SetQueryParam("app_name", request.AppName);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/app/modify_app_name 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppModifyAppNameV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppModifyAppNameV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "app", "modify_app_name")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "modify_app_name"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/app/modify_app_intro 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppModifyAppIntroductionV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppModifyAppIntroductionV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "app", "modify_app_intro")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "modify_app_intro"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/app/modify_app_icon 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppModifyAppIconV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppModifyAppIconV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "app", "modify_app_icon")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "modify_app_icon"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/app/all_categories 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppAllCategoriesV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppAllCategoriesV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "app", "all_categories")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "all_categories"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/app/categories 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppCategoriesV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppCategoriesV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "app", "categories")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "categories"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/app/add_categories 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppAddCategoriesV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppAddCategoriesV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "app", "add_categories")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "add_categories"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/app/del_categories 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppDeleteCategoriesV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppDeleteCategoriesV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "app", "del_categories")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "del_categories"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/app/supply_categories 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppSupplyCategoriesV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppSupplyCategoriesV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "app", "supply_categories")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "supply_categories"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/app/modify_server_domain 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppModifyServerDomainV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppModifyServerDomainV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "app", "modify_server_domain")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "modify_server_domain"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/app/modify_webview_domain 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppModifyWebviewDomainV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppModifyWebviewDomainV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "app", "modify_webview_domain")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "modify_webview_domain"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/app/quality_rating 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2023-10-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppQualityRatingV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppQualityRatingV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "app", "quality_rating")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "quality_rating"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/app/credit_score 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiMicroAppAppCreditScoreV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppAppCreditScoreV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "app", "credit_score")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "app", "credit_score"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ #endregion
+
+ #region Operation
+ ///
+ /// 异步调用 [GET] /v1/microapp/operation/video_application_status 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationVideoApplicationStatusV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationVideoApplicationStatusV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "operation", "video_application_status")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "video_application_status"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/operation/video_application 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationVideoApplicationV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationVideoApplicationV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "operation", "video_application")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "video_application"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/operation/live_application_status 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationLiveApplicationStatusV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationLiveApplicationStatusV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "operation", "live_application_status")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "live_application_status"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/operation/live_application 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationLiveApplicationV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationLiveApplicationV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "operation", "live_application")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "live_application"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/operation/phone_number_application_status 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationPhoneNumberApplicationStatusV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationPhoneNumberApplicationStatusV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "operation", "phone_number_application_status")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "phone_number_application_status"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/operation/phone_number_application 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationPhoneNumberApplicationV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationPhoneNumberApplicationV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "operation", "phone_number_application")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "phone_number_application"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/operation/share_tpl_list 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationShareTemplateListV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationShareTemplateListV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "operation", "share_tpl_list")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "share_tpl_list"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken)
+ .SetQueryParam("page", request.PageNumber)
+ .SetQueryParam("size", request.PageSize);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/operation/add_share_tpl 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationAddShareTemplateV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationAddShareTemplateV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "operation", "add_share_tpl")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "add_share_tpl"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/operation/modify_share_tpl 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationModifyShareTemplateV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationModifyShareTemplateV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "operation", "modify_share_tpl")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "modify_share_tpl"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/operation/del_share_tpl 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationDeleteShareTemplateV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationDeleteShareTemplateV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "operation", "del_share_tpl")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "del_share_tpl"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/operation/set_default_share_tpl 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationSetDefaultShareTemplateV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationSetDefaultShareTemplateV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "operation", "set_default_share_tpl")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "set_default_share_tpl"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/operation/add_shop_material 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationAddShopMaterialV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationAddShopMaterialV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "operation", "add_shop_material")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "add_shop_material"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/operation/query_shop_material 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiMicroAppOperationQueryShopMaterialV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppOperationQueryShopMaterialV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "operation", "query_shop_material")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "operation", "query_shop_material"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken)
+ .SetQueryParam("supplier_ext_id", request.SupplierExternalId);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ #endregion
+
+ #region Package
+ ///
+ /// 异步调用 [POST] /v1/microapp/package/upload 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-02-21 下线。")]
+ public static async Task ExecuteOpenApiMicroAppPackageUploadV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppPackageUploadV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "package", "upload")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "package", "upload"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/package/audit_hosts 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-02-21 下线。")]
+ public static async Task ExecuteOpenApiMicroAppPackageAuditHostsV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppPackageAuditHostsV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "package", "audit_hosts")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "package", "audit_hosts"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v2/microapp/package/audit 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-02-21 下线。")]
+ public static async Task ExecuteOpenApiMicroAppPackageAuditV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppPackageAuditV2Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v2", "microapp", "package", "audit")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v2", "microapp", "package", "audit"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/package/revoke_audit 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-02-21 下线。")]
+ public static async Task ExecuteOpenApiMicroAppPackageRevokeAuditV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppPackageRevokeAuditV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "package", "revoke_audit")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "package", "revoke_audit"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/package/release 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-02-21 下线。")]
+ public static async Task ExecuteOpenApiMicroAppPackageReleaseV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppPackageReleaseV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "package", "release")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "package", "release"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/microapp/package/rollback 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-02-21 下线。")]
+ public static async Task ExecuteOpenApiMicroAppPackageRollbackV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppPackageRollbackV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "microapp", "package", "rollback")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "package", "rollback"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/microapp/package/versions 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-02-21 下线。")]
+ public static async Task ExecuteOpenApiMicroAppPackageVersionsV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiMicroAppPackageVersionsV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "microapp", "package", "versions")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "microapp", "package", "versions"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("authorizer_access_token", request.AuthorizerAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ #endregion
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacySettleExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacySettleExtensions.cs
new file mode 100644
index 00000000..24bbd334
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacySettleExtensions.cs
@@ -0,0 +1,88 @@
+using System;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteLegacySettleExtensions
+ {
+ ///
+ /// 异步调用 [POST] /v1/settle/pre_check 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiSettlePreCheckV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiSettlePreCheckV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "settle", "pre_check")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "settle", "pre_check"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/settle/apply 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiSettleApplyV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiSettleApplyV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "settle", "apply")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "settle", "apply"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/settle/get_apply_status 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiSettleGetApplyStatusV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiSettleGetApplyStatusV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "settle", "get_apply_status")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "settle", "get_apply_status"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken)
+ .SetQueryParam("apply_id", request.ApplyId);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacyThirdPartyExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacyThirdPartyExtensions.cs
new file mode 100644
index 00000000..b66fca2e
--- /dev/null
+++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteLegacyThirdPartyExtensions.cs
@@ -0,0 +1,364 @@
+using System;
+using System.Net.Http;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Flurl;
+using Flurl.Http;
+
+namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
+{
+ public static class DouyinMicroAppOpenApiClientExecuteLegacyThirdPartyExtensions
+ {
+ ///
+ /// 异步调用 [GET] /v1/tp/auth_app_list 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiThirdPartyAuthAppListV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiThirdPartyAuthAppListV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "tp", "auth_app_list")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "tp", "auth_app_list"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken)
+ .SetQueryParam("page", request.PageNumber)
+ .SetQueryParam("size", request.PageSize);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/tp/upload_pic_material 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("相关接口或字段于 2024-01-23 下线。")]
+ public static async Task ExecuteOpenApiThirdPartyUploadPictureMaterialV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiThirdPartyUploadPictureMaterialV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ if (request.MaterialFileName is null)
+ request.MaterialFileName = Guid.NewGuid().ToString("N").ToLower() + ".jpg";
+
+ if (request.MaterialFileContentType is null)
+ request.MaterialFileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForMaterial(request.MaterialFileName) ?? "image/jpeg";
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "tp", "upload_pic_material")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "tp", "upload_pic_material"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken);
+
+ using var httpContent = Utilities.FileHttpContentBuilder.Build(fileName: request.MaterialFileName, fileBytes: request.MaterialFileBytes, fileContentType: request.MaterialFileContentType, formDataName: "material_file");
+ httpContent.Add(new ByteArrayContent(Encoding.UTF8.GetBytes(request.MaterialType.ToString())), "material_type");
+
+ return await client.SendFlurlRequestAsync(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ #region Domain
+ ///
+ /// 异步调用 [GET] /v1/tp/download/webview_file 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiThirdPartyDownloadWebviewFileV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiThirdPartyDownloadWebviewFileV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "tp", "download", "webview_file")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "tp", "download", "webview_file"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ #endregion
+
+ #region POI
+ ///
+ /// 异步调用 [POST] /v1/tp/poi/supplier/match 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiThirdPartyPOISupplierMatchV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiThirdPartyPOISupplierMatchV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "tp", "poi", "supplier", "match")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "tp", "poi", "supplier", "match"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/tp/poi/supplier/query/match_task 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiThirdPartyPOISupplierQueryMatchTaskV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiThirdPartyPOISupplierQueryMatchTaskV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "tp", "poi", "supplier", "query", "match_task")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "tp", "poi", "supplier", "query", "match_task"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken)
+ .SetQueryParam("task_ids", string.Join(",", request.TaskIdList));
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/tp/poi/supplier/query/match 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiThirdPartyPOISupplierQueryMatchV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiThirdPartyPOISupplierQueryMatchV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "tp", "poi", "supplier", "query", "match")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "tp", "poi", "supplier", "query", "match"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken)
+ .SetQueryParam("supplier_ext_ids", string.Join(",", request.SupplierExternalIds));
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [POST] /v1/tp/poi/supplier/sync 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiThirdPartyPOISupplierSyncV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiThirdPartyPOISupplierSyncV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Post, "v1", "tp", "poi", "supplier", "sync")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "tp", "poi", "supplier", "sync"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 异步调用 [GET] /v1/tp/poi/supplier/query 接口。
+ ///
+ /// REF:
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task ExecuteOpenApiThirdPartyPOISupplierQueryV1Async(this DouyinMicroAppOpenApiClient client, Models.OpenApiThirdPartyPOISupplierQueryV1Request request, CancellationToken cancellationToken = default)
+ {
+ if (client is null) throw new ArgumentNullException(nameof(client));
+ if (request is null) throw new ArgumentNullException(nameof(request));
+
+ IFlurlRequest flurlReq = client
+ .CreateFlurlRequest(request, HttpMethod.Get, "v1", "tp", "poi", "supplier", "query")
+ .WithUrl(url => new Url(client._BASEURL_LEGACY).AppendPathSegments("v1", "tp", "poi", "supplier", "query"))
+ .SetQueryParam("component_appid", request.ComponentAppId)
+ .SetQueryParam("component_access_token", request.ComponentAccessToken)
+ .SetQueryParam("supplier_ext_id", request.SupplierExternalId);
+
+ return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ ///