-
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.
feat(microapp): 新增小程序 URL Schema 相关接口
- Loading branch information
Showing
14 changed files
with
270 additions
and
2 deletions.
There are no files selected for viewing
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
43 changes: 43 additions & 0 deletions
43
...lurlHttpClient.ByteDance.MicroApp/Models/Apps/UrlSchema/AppsUrlGenerateSchemaV1Request.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,43 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/url/generate_schema 接口的请求。</para> | ||
/// </summary> | ||
public class AppsUrlGenerateSchemaV1Request : DouyinMicroAppRequest | ||
{ | ||
/// <summary> | ||
/// 获取或设置小程序的 AppId。如果不指定将使用构造 <see cref="DouyinMicroAppClient"/> 时的 <see cref="DouyinMicroAppClientOptions.AppId"/> 参数。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("app_id")] | ||
[System.Text.Json.Serialization.JsonPropertyName("app_id")] | ||
public string? AppId { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置页面路径。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("path")] | ||
[System.Text.Json.Serialization.JsonPropertyName("path")] | ||
public string? PagePath { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置页面查询参数。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("query")] | ||
[System.Text.Json.Serialization.JsonPropertyName("query")] | ||
public string? QueryString { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置是否永不失效。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("no_expire")] | ||
[System.Text.Json.Serialization.JsonPropertyName("no_expire")] | ||
public bool IsNoExpire { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置失效时间戳。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("expire_time")] | ||
[System.Text.Json.Serialization.JsonPropertyName("expire_time")] | ||
public long? ExpireTimestamp { get; set; } | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...urlHttpClient.ByteDance.MicroApp/Models/Apps/UrlSchema/AppsUrlGenerateSchemaV1Response.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,28 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/url/generate_schema 接口的响应。</para> | ||
/// </summary> | ||
public class AppsUrlGenerateSchemaV1Response : DouyinMicroAppResponse | ||
{ | ||
public static class Types | ||
{ | ||
public class Data | ||
{ | ||
/// <summary> | ||
/// 获取或设置链接。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("schema")] | ||
[System.Text.Json.Serialization.JsonPropertyName("schema")] | ||
public string UrlSchema { get; set; } = default!; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// 获取或设置返回数据。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("data")] | ||
[System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public Types.Data Data { get; set; } = default!; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...rlHttpClient.ByteDance.MicroApp/Models/Apps/UrlSchema/AppsUrlQuerySchemaQuotaV1Request.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,15 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/url/query_schema_quota 接口的请求。</para> | ||
/// </summary> | ||
public class AppsUrlQuerySchemaQuotaV1Request : DouyinMicroAppRequest | ||
{ | ||
/// <summary> | ||
/// 获取或设置小程序的 AppId。如果不指定将使用构造 <see cref="DouyinMicroAppClient"/> 时的 <see cref="DouyinMicroAppClientOptions.AppId"/> 参数。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("app_id")] | ||
[System.Text.Json.Serialization.JsonPropertyName("app_id")] | ||
public string? AppId { get; set; } | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...lHttpClient.ByteDance.MicroApp/Models/Apps/UrlSchema/AppsUrlQuerySchemaQuotaV1Response.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,55 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/url/query_schema_quota 接口的响应。</para> | ||
/// </summary> | ||
public class AppsUrlQuerySchemaQuotaV1Response : DouyinMicroAppResponse | ||
{ | ||
public static class Types | ||
{ | ||
public class Data | ||
{ | ||
public static class Types | ||
{ | ||
public class Quota | ||
{ | ||
/// <summary> | ||
/// 获取或设置已生成次数。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("schema_used")] | ||
[System.Text.Json.Serialization.JsonPropertyName("schema_used")] | ||
public int UsedCount { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置次数上限。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("schema_limit")] | ||
[System.Text.Json.Serialization.JsonPropertyName("schema_limit")] | ||
public int LimitCount { get; set; } | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// 获取或设置长期有效的配额信息。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("long_term_schema_quota")] | ||
[System.Text.Json.Serialization.JsonPropertyName("long_term_schema_quota")] | ||
public Types.Quota LongTermQuota { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 获取或设置短期有效的配额信息。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("short_term_schema_quota")] | ||
[System.Text.Json.Serialization.JsonPropertyName("short_term_schema_quota")] | ||
public Types.Quota ShortTermQuota { 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
...T.FlurlHttpClient.ByteDance.MicroApp/Models/Apps/UrlSchema/AppsUrlQuerySchemaV1Request.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/url/query_schema 接口的请求。</para> | ||
/// </summary> | ||
public class AppsUrlQuerySchemaV1Request : DouyinMicroAppRequest | ||
{ | ||
/// <summary> | ||
/// 获取或设置小程序的 AppId。如果不指定将使用构造 <see cref="DouyinMicroAppClient"/> 时的 <see cref="DouyinMicroAppClientOptions.AppId"/> 参数。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("app_id")] | ||
[System.Text.Json.Serialization.JsonPropertyName("app_id")] | ||
public string? AppId { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置链接。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("schema")] | ||
[System.Text.Json.Serialization.JsonPropertyName("schema")] | ||
public string UrlSchema { get; set; } = string.Empty; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
....FlurlHttpClient.ByteDance.MicroApp/Models/Apps/UrlSchema/AppsUrlQuerySchemaV1Response.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,56 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/url/query_schema 接口的响应。</para> | ||
/// </summary> | ||
public class AppsUrlQuerySchemaV1Response : DouyinMicroAppResponse | ||
{ | ||
public static class Types | ||
{ | ||
public class Data | ||
{ | ||
/// <summary> | ||
/// 获取或设置小程序的 AppId。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("app_id")] | ||
[System.Text.Json.Serialization.JsonPropertyName("app_id")] | ||
public string AppId { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 获取或设置页面路径。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("path")] | ||
[System.Text.Json.Serialization.JsonPropertyName("path")] | ||
public string? PagePath { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置页面查询参数。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("query")] | ||
[System.Text.Json.Serialization.JsonPropertyName("query")] | ||
public string? QueryString { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置生成时间戳。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("create_time")] | ||
[System.Text.Json.Serialization.JsonPropertyName("create_time")] | ||
public long CreateTimestamp { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置失效时间戳。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("expire_time")] | ||
[System.Text.Json.Serialization.JsonPropertyName("expire_time")] | ||
public long ExpireTimestamp { get; set; } | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// 获取或设置返回数据。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("data")] | ||
[System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public Types.Data Data { get; set; } = default!; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ance.MicroApp.UnitTests/ModelSamples/_/Apps/UrlSchema/AppsUrlGenerateSchemaV1Request.json
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,7 @@ | ||
{ | ||
"app_id": "tt5da*****", | ||
"query": "{\"key1\":\"val1\",\"key2\":\"val2\"}", | ||
"path": "test_miniapp", | ||
"no_expire": false, | ||
"expire_time": 1685090014 | ||
} |
8 changes: 8 additions & 0 deletions
8
...nce.MicroApp.UnitTests/ModelSamples/_/Apps/UrlSchema/AppsUrlGenerateSchemaV1Response.json
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,8 @@ | ||
{ | ||
"data": { | ||
"schema": "sslocal://miniapp?ticket=v1_*****" | ||
}, | ||
"err_msg": "", | ||
"err_no": 0, | ||
"log_id": "20230828105040791DAA4F7CABB43F2E0D" | ||
} |
3 changes: 3 additions & 0 deletions
3
...ce.MicroApp.UnitTests/ModelSamples/_/Apps/UrlSchema/AppsUrlQuerySchemaQuotaV1Request.json
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,3 @@ | ||
{ | ||
"app_id": "tt********" | ||
} |
15 changes: 15 additions & 0 deletions
15
...e.MicroApp.UnitTests/ModelSamples/_/Apps/UrlSchema/AppsUrlQuerySchemaQuotaV1Response.json
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,15 @@ | ||
{ | ||
"err_no": 0, | ||
"log_id": "20230828114955870A641D59241500963C", | ||
"data": { | ||
"long_term_schema_quota": { | ||
"schema_used": 6, | ||
"schema_limit": 0 | ||
}, | ||
"short_term_schema_quota": { | ||
"schema_limit": 0, | ||
"schema_used": 0 | ||
} | ||
}, | ||
"err_msg": "" | ||
} |
4 changes: 4 additions & 0 deletions
4
...teDance.MicroApp.UnitTests/ModelSamples/_/Apps/UrlSchema/AppsUrlQuerySchemaV1Request.json
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,4 @@ | ||
{ | ||
"schema": "sslocal://miniapp?ticket=v1_*****", | ||
"app_id": "tt*****" | ||
} |
12 changes: 12 additions & 0 deletions
12
...eDance.MicroApp.UnitTests/ModelSamples/_/Apps/UrlSchema/AppsUrlQuerySchemaV1Response.json
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,12 @@ | ||
{ | ||
"data": { | ||
"app_id": "tt******", | ||
"path": "page/index", | ||
"query": "{}", | ||
"create_time": 1682075227, | ||
"expire_time": 0 | ||
}, | ||
"err_msg": "", | ||
"err_no": 0, | ||
"log_id": "2023********7AB1" | ||
} |