-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
425 additions
and
16 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
...ent.ByteDance.MicroApp/Extensions/DouyinMicroAppClientExecuteAppsAdPlacementExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
using System.Net.Http; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Flurl.Http; | ||
|
||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp | ||
{ | ||
public static class DouyinMicroAppClientExecuteAppsAdPlacementExtensions | ||
{ | ||
/// <summary> | ||
/// <para>异步调用 [GET] /apps/v1/ad_placement/query/ 接口。</para> | ||
/// <para> | ||
/// REF: <br/> | ||
/// <![CDATA[ https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/traffic-permission/query-ad-placement-list ]]> | ||
/// </para> | ||
/// </summary> | ||
/// <param name="client"></param> | ||
/// <param name="request"></param> | ||
/// <param name="cancellationToken"></param> | ||
/// <returns></returns> | ||
public static async Task<Models.AppsAdPlacementQueryV1Response> ExecuteAppsAdPlacementQueryV1Async(this DouyinMicroAppClient client, Models.AppsAdPlacementQueryV1Request 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", "ad_placement", "query", "") | ||
.WithHeader("access-token", request.AccessToken); | ||
|
||
return await client.SendFlurlRequestAsJsonAsync<Models.AppsAdPlacementQueryV1Response>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
|
||
/// <summary> | ||
/// <para>异步调用 [POST] /apps/v1/ad_placement/add/ 接口。</para> | ||
/// <para> | ||
/// REF: <br/> | ||
/// <![CDATA[ https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/traffic-permission/add-ad-placement ]]> | ||
/// </para> | ||
/// </summary> | ||
/// <param name="client"></param> | ||
/// <param name="request"></param> | ||
/// <param name="cancellationToken"></param> | ||
/// <returns></returns> | ||
public static async Task<Models.AppsAdPlacementAddV1Response> ExecuteAppsAdPlacementAddV1Async(this DouyinMicroAppClient client, Models.AppsAdPlacementAddV1Request 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", "ad_placement", "add", "") | ||
.WithHeader("access-token", request.AccessToken); | ||
|
||
return await client.SendFlurlRequestAsJsonAsync<Models.AppsAdPlacementAddV1Response>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
|
||
/// <summary> | ||
/// <para>异步调用 [POST] /apps/v1/ad_placement/update/ 接口。</para> | ||
/// <para> | ||
/// REF: <br/> | ||
/// <![CDATA[ https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/traffic-permission/update-ad-placement-status ]]> | ||
/// </para> | ||
/// </summary> | ||
/// <param name="client"></param> | ||
/// <param name="request"></param> | ||
/// <param name="cancellationToken"></param> | ||
/// <returns></returns> | ||
public static async Task<Models.AppsAdPlacementUpdateV1Response> ExecuteAppsAdPlacementUpdateV1Async(this DouyinMicroAppClient client, Models.AppsAdPlacementUpdateV1Request 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", "ad_placement", "update", "") | ||
.WithHeader("access-token", request.AccessToken); | ||
|
||
return await client.SendFlurlRequestAsJsonAsync<Models.AppsAdPlacementUpdateV1Response>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
...teDance.MicroApp/Extensions/DouyinMicroAppClientExecuteAppsTrafficPermissionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
{ | ||
public static class DouyinMicroAppClientExecuteAppsTrafficPermissionExtensions | ||
{ | ||
/// <summary> | ||
/// <para>异步调用 [GET] /apps/v1/traffic_permission/query/ 接口。</para> | ||
/// <para> | ||
/// REF: <br/> | ||
/// <![CDATA[ https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/traffic-permission/query-status ]]> | ||
/// </para> | ||
/// </summary> | ||
/// <param name="client"></param> | ||
/// <param name="request"></param> | ||
/// <param name="cancellationToken"></param> | ||
/// <returns></returns> | ||
public static async Task<Models.AppsTrafficPermissionQueryV1Response> ExecuteAppsTrafficPermissionQueryV1Async(this DouyinMicroAppClient client, Models.AppsTrafficPermissionQueryV1Request 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", "traffic_permission", "query", "") | ||
.WithHeader("access-token", request.AccessToken); | ||
|
||
return await client.SendFlurlRequestAsJsonAsync<Models.AppsTrafficPermissionQueryV1Response>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
|
||
/// <summary> | ||
/// <para>异步调用 [POST] /apps/v1/traffic_permission/open/ 接口。</para> | ||
/// <para> | ||
/// REF: <br/> | ||
/// <![CDATA[ https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/traffic-permission/open-traffic-permission ]]> | ||
/// </para> | ||
/// </summary> | ||
/// <param name="client"></param> | ||
/// <param name="request"></param> | ||
/// <param name="cancellationToken"></param> | ||
/// <returns></returns> | ||
public static async Task<Models.AppsTrafficPermissionOpenV1Response> ExecuteAppsTrafficPermissionOpenV1Async(this DouyinMicroAppClient client, Models.AppsTrafficPermissionOpenV1Request 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", "traffic_permission", "open", "") | ||
.WithHeader("access-token", request.AccessToken); | ||
|
||
return await client.SendFlurlRequestAsJsonAsync<Models.AppsTrafficPermissionOpenV1Response>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
....FlurlHttpClient.ByteDance.MicroApp/Models/AppsAdPlacement/AppsAdPlacementAddV1Request.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/ad_placement/add/ 接口的请求。</para> | ||
/// </summary> | ||
public class AppsAdPlacementAddV1Request : DouyinMicroAppRequest | ||
{ | ||
/// <summary> | ||
/// 获取或设置广告位名称。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("ad_placement_name")] | ||
[System.Text.Json.Serialization.JsonPropertyName("ad_placement_name")] | ||
public string AdPlacementName { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// 获取或设置广告位类型。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("ad_placement_type")] | ||
[System.Text.Json.Serialization.JsonPropertyName("ad_placement_type")] | ||
public int AdPlacementType { get; set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...FlurlHttpClient.ByteDance.MicroApp/Models/AppsAdPlacement/AppsAdPlacementAddV1Response.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/ad_placement/add/ 接口的响应。</para> | ||
/// </summary> | ||
public class AppsAdPlacementAddV1Response : DouyinMicroAppResponse | ||
{ | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...lurlHttpClient.ByteDance.MicroApp/Models/AppsAdPlacement/AppsAdPlacementQueryV1Request.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [GET] /apps/v1/ad_placement/query/ 接口的请求。</para> | ||
/// </summary> | ||
public class AppsAdPlacementQueryV1Request : DouyinMicroAppRequest | ||
{ | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...urlHttpClient.ByteDance.MicroApp/Models/AppsAdPlacement/AppsAdPlacementQueryV1Response.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [GET] /apps/v1/ad_placement/query/ 接口的响应。</para> | ||
/// </summary> | ||
public class AppsAdPlacementQueryV1Response : DouyinMicroAppResponse | ||
{ | ||
public static class Types | ||
{ | ||
public class Data | ||
{ | ||
public static class Types | ||
{ | ||
public class AdPlacement | ||
{ | ||
/// <summary> | ||
/// 获取或设置广告位 ID。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("ad_placement_id")] | ||
[System.Text.Json.Serialization.JsonPropertyName("ad_placement_id")] | ||
public string AdPlacementId { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 获取或设置广告位名称。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("ad_placement_name")] | ||
[System.Text.Json.Serialization.JsonPropertyName("ad_placement_name")] | ||
public string AdPlacementName { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 获取或设置广告位类型。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("ad_placement_type")] | ||
[System.Text.Json.Serialization.JsonPropertyName("ad_placement_type")] | ||
public int AdPlacementType { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置状态。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("status")] | ||
[System.Text.Json.Serialization.JsonPropertyName("status")] | ||
public int Status { get; set; } | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// 获取或设置广告位列表。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("ad_placement_list")] | ||
[System.Text.Json.Serialization.JsonPropertyName("ad_placement_list")] | ||
public Types.AdPlacement[] AdPlacementList { get; set; } = default!; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// 获取或设置返回数据。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("data")] | ||
[System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public Types.Data Data { get; set; } = default!; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...urlHttpClient.ByteDance.MicroApp/Models/AppsAdPlacement/AppsAdPlacementUpdateV1Request.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/ad_placement/update/ 接口的请求。</para> | ||
/// </summary> | ||
public class AppsAdPlacementUpdateV1Request : DouyinMicroAppRequest | ||
{ | ||
/// <summary> | ||
/// 获取或设置广告位 ID。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("ad_placement_id")] | ||
[System.Text.Json.Serialization.JsonPropertyName("ad_placement_id")] | ||
public string AdPlacementId { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// 获取或设置状态。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("status")] | ||
[System.Text.Json.Serialization.JsonPropertyName("status")] | ||
public int Status { get; set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...rlHttpClient.ByteDance.MicroApp/Models/AppsAdPlacement/AppsAdPlacementUpdateV1Response.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/ad_placement/update/ 接口的响应。</para> | ||
/// </summary> | ||
public class AppsAdPlacementUpdateV1Response : DouyinMicroAppResponse | ||
{ | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
...ent.ByteDance.MicroApp/Models/AppsTrafficPermission/AppsTrafficPermissionOpenV1Request.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/traffic_permission/open/ 接口的请求。</para> | ||
/// </summary> | ||
public class AppsTrafficPermissionOpenV1Request : DouyinMicroAppRequest | ||
{ | ||
/// <summary> | ||
/// 获取或设置省份。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("province")] | ||
[System.Text.Json.Serialization.JsonPropertyName("province")] | ||
public string Province { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// 获取或设置城市。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("city")] | ||
[System.Text.Json.Serialization.JsonPropertyName("city")] | ||
public string City { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// 获取或设置手机号码。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("phone_number")] | ||
[System.Text.Json.Serialization.JsonPropertyName("phone_number")] | ||
public string PhoneNumber { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// 获取或设置纳税人性质。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("tax_nature")] | ||
[System.Text.Json.Serialization.JsonPropertyName("tax_nature")] | ||
public int TaxNatureType { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置银行账号。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("bank_account_number")] | ||
[System.Text.Json.Serialization.JsonPropertyName("bank_account_number")] | ||
public string BankAccountNumber { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// 获取或设置开户银行名称。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("bank_name")] | ||
[System.Text.Json.Serialization.JsonPropertyName("bank_name")] | ||
public string BankName { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// 获取或设置开户支行名称。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("bank_branch")] | ||
[System.Text.Json.Serialization.JsonPropertyName("bank_branch")] | ||
public string BankBranch { get; set; } = string.Empty; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...nt.ByteDance.MicroApp/Models/AppsTrafficPermission/AppsTrafficPermissionOpenV1Response.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/traffic_permission/open/ 接口的响应。</para> | ||
/// </summary> | ||
public class AppsTrafficPermissionOpenV1Response : DouyinMicroAppResponse | ||
{ | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...nt.ByteDance.MicroApp/Models/AppsTrafficPermission/AppsTrafficPermissionQueryV1Request.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [GET] /apps/v1/traffic_permission/query/ 接口的请求。</para> | ||
/// </summary> | ||
public class AppsTrafficPermissionQueryV1Request : DouyinMicroAppRequest | ||
{ | ||
} | ||
} |
Oops, something went wrong.