From 3b39dca8ba579fcd142779a18b803a9b6d5968e9 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Fri, 8 Nov 2024 12:03:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(microapp):=20=E6=96=B0=E5=A2=9E=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=95=86=E5=B9=B3=E5=8F=B0=E8=8E=B7=E5=8F=96=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E6=A0=A1=E9=AA=8C=E6=96=87=E4=BB=B6=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...enApiClientExecuteTpAppDomainExtensions.cs | 34 ++++++++++++++++++ ...pDomainGetWebviewCheckFileInfoV2Request.cs | 9 +++++ ...DomainGetWebviewCheckFileInfoV2Response.cs | 35 +++++++++++++++++++ ...mainGetWebviewCheckFileInfoV2Response.json | 9 +++++ 4 files changed, 87 insertions(+) create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteTpAppDomainExtensions.cs create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Models/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Request.cs create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Models/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Response.cs create mode 100644 test/SKIT.FlurlHttpClient.ByteDance.MicroApp.UnitTests/ModelSamples/OpenApi/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Response.json diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteTpAppDomainExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteTpAppDomainExtensions.cs new file mode 100644 index 00000000..6a176b0e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Extensions/DouyinMicroAppOpenApiClientExecuteTpAppDomainExtensions.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 DouyinMicroAppOpenApiClientExecuteTpAppDomainExtensions + { + /// + /// 异步调用 [GET] /tpapp/v2/doamin/get_webview_check_file_info/ 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteOpenTpAppDomainGetWebviewCheckFileInfoV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenTpAppDomainGetWebviewCheckFileInfoV2Request 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, "tpapp", "v2", "doamin", "get_webview_check_file_info/") + .WithHeader("access-token", request.ComponentAccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Models/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Request.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Models/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Request.cs new file mode 100644 index 00000000..4dbf4c82 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Models/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Request.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Models +{ + /// + /// 表示 [GET] /tpapp/v2/doamin/get_webview_check_file_info/ 接口的请求。 + /// + public class OpenTpAppDomainGetWebviewCheckFileInfoV2Request : DouyinMicroAppOpenApiRequest + { + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Models/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Response.cs b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Models/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Response.cs new file mode 100644 index 00000000..697efca1 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.MicroApp/ExtendedSDK/OpenApi/Models/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Response.cs @@ -0,0 +1,35 @@ +namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Models +{ + /// + /// 表示 [GET] /tpapp/v2/doamin/get_webview_check_file_info/ 接口的响应。 + /// + public class OpenTpAppDomainGetWebviewCheckFileInfoV2Response : DouyinMicroAppOpenApiResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置文件名。 + /// + [Newtonsoft.Json.JsonProperty("file_name")] + [System.Text.Json.Serialization.JsonPropertyName("file_name")] + public string FileName { get; set; } = default!; + + /// + /// 获取或设置文件内容。 + /// + [Newtonsoft.Json.JsonProperty("file_content")] + [System.Text.Json.Serialization.JsonPropertyName("file_content")] + public string FileContent { get; set; } = default!; + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("data")] + [System.Text.Json.Serialization.JsonPropertyName("data")] + public Types.Data Data { get; set; } = default!; + } +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.MicroApp.UnitTests/ModelSamples/OpenApi/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Response.json b/test/SKIT.FlurlHttpClient.ByteDance.MicroApp.UnitTests/ModelSamples/OpenApi/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Response.json new file mode 100644 index 00000000..37f8a04f --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.MicroApp.UnitTests/ModelSamples/OpenApi/TpAppDomain/OpenTpAppDomainGetWebviewCheckFileInfoV2Response.json @@ -0,0 +1,9 @@ +{ + "err_no": 0, + "log_id": "20240115162426455AC338E18B56745303", + "data": { + "file_content": "xxxxxx", + "file_name": "xxxx.txt" + }, + "err_msg": "" +}