Skip to content

Commit

Permalink
feat(microapp): 新增服务商平台获取域名校验文件信息接口
Browse files Browse the repository at this point in the history
  • Loading branch information
fudiwei committed Nov 8, 2024
1 parent fd58fff commit 3b39dca
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// <para>异步调用 [GET] /tpapp/v2/doamin/get_webview_check_file_info/ 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/domain/get-webview-check-file-info ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.OpenTpAppDomainGetWebviewCheckFileInfoV2Response> 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<Models.OpenTpAppDomainGetWebviewCheckFileInfoV2Response>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Models
{
/// <summary>
/// <para>表示 [GET] /tpapp/v2/doamin/get_webview_check_file_info/ 接口的请求。</para>
/// </summary>
public class OpenTpAppDomainGetWebviewCheckFileInfoV2Request : DouyinMicroAppOpenApiRequest
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Models
{
/// <summary>
/// <para>表示 [GET] /tpapp/v2/doamin/get_webview_check_file_info/ 接口的响应。</para>
/// </summary>
public class OpenTpAppDomainGetWebviewCheckFileInfoV2Response : DouyinMicroAppOpenApiResponse
{
public static class Types
{
public class Data
{
/// <summary>
/// 获取或设置文件名。
/// </summary>
[Newtonsoft.Json.JsonProperty("file_name")]
[System.Text.Json.Serialization.JsonPropertyName("file_name")]
public string FileName { get; set; } = default!;

/// <summary>
/// 获取或设置文件内容。
/// </summary>
[Newtonsoft.Json.JsonProperty("file_content")]
[System.Text.Json.Serialization.JsonPropertyName("file_content")]
public string FileContent { get; set; } = default!;
}
}

/// <summary>
/// 获取或设置返回数据。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public Types.Data Data { get; set; } = default!;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"err_no": 0,
"log_id": "20240115162426455AC338E18B56745303",
"data": {
"file_content": "xxxxxx",
"file_name": "xxxx.txt"
},
"err_msg": ""
}

0 comments on commit 3b39dca

Please sign in to comment.