Skip to content

Commit 3b39dca

Browse files
committed
feat(microapp): 新增服务商平台获取域名校验文件信息接口
1 parent fd58fff commit 3b39dca

4 files changed

Lines changed: 87 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System;
2+
using System.Net.Http;
3+
using System.Threading;
4+
using System.Threading.Tasks;
5+
using Flurl.Http;
6+
7+
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi
8+
{
9+
public static class DouyinMicroAppOpenApiClientExecuteTpAppDomainExtensions
10+
{
11+
/// <summary>
12+
/// <para>异步调用 [GET] /tpapp/v2/doamin/get_webview_check_file_info/ 接口。</para>
13+
/// <para>
14+
/// REF: <br/>
15+
/// <![CDATA[ https://developer.open-douyin.com/docs/resource/zh-CN/thirdparty/API/smallprogram/domain/get-webview-check-file-info ]]>
16+
/// </para>
17+
/// </summary>
18+
/// <param name="client"></param>
19+
/// <param name="request"></param>
20+
/// <param name="cancellationToken"></param>
21+
/// <returns></returns>
22+
public static async Task<Models.OpenTpAppDomainGetWebviewCheckFileInfoV2Response> ExecuteOpenTpAppDomainGetWebviewCheckFileInfoV2Async(this DouyinMicroAppOpenApiClient client, Models.OpenTpAppDomainGetWebviewCheckFileInfoV2Request request, CancellationToken cancellationToken = default)
23+
{
24+
if (client is null) throw new ArgumentNullException(nameof(client));
25+
if (request is null) throw new ArgumentNullException(nameof(request));
26+
27+
IFlurlRequest flurlReq = client
28+
.CreateFlurlRequest(request, HttpMethod.Get, "tpapp", "v2", "doamin", "get_webview_check_file_info/")
29+
.WithHeader("access-token", request.ComponentAccessToken);
30+
31+
return await client.SendFlurlRequestAsJsonAsync<Models.OpenTpAppDomainGetWebviewCheckFileInfoV2Response>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
32+
}
33+
}
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [GET] /tpapp/v2/doamin/get_webview_check_file_info/ 接口的请求。</para>
5+
/// </summary>
6+
public class OpenTpAppDomainGetWebviewCheckFileInfoV2Request : DouyinMicroAppOpenApiRequest
7+
{
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.ExtendedSDK.OpenApi.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [GET] /tpapp/v2/doamin/get_webview_check_file_info/ 接口的响应。</para>
5+
/// </summary>
6+
public class OpenTpAppDomainGetWebviewCheckFileInfoV2Response : DouyinMicroAppOpenApiResponse
7+
{
8+
public static class Types
9+
{
10+
public class Data
11+
{
12+
/// <summary>
13+
/// 获取或设置文件名。
14+
/// </summary>
15+
[Newtonsoft.Json.JsonProperty("file_name")]
16+
[System.Text.Json.Serialization.JsonPropertyName("file_name")]
17+
public string FileName { get; set; } = default!;
18+
19+
/// <summary>
20+
/// 获取或设置文件内容。
21+
/// </summary>
22+
[Newtonsoft.Json.JsonProperty("file_content")]
23+
[System.Text.Json.Serialization.JsonPropertyName("file_content")]
24+
public string FileContent { get; set; } = default!;
25+
}
26+
}
27+
28+
/// <summary>
29+
/// 获取或设置返回数据。
30+
/// </summary>
31+
[Newtonsoft.Json.JsonProperty("data")]
32+
[System.Text.Json.Serialization.JsonPropertyName("data")]
33+
public Types.Data Data { get; set; } = default!;
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"err_no": 0,
3+
"log_id": "20240115162426455AC338E18B56745303",
4+
"data": {
5+
"file_content": "xxxxxx",
6+
"file_name": "xxxx.txt"
7+
},
8+
"err_msg": ""
9+
}

0 commit comments

Comments
 (0)