-
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
9 changed files
with
148 additions
and
5 deletions.
There are no files selected for viewing
91 changes: 91 additions & 0 deletions
91
src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Models/Apps/Qrcode/AppsQrcodeCreateV1Request.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,91 @@ | ||
namespace SKIT.FlurlHttpClient.ByteDance.MicroApp.Models | ||
{ | ||
/// <summary> | ||
/// <para>表示 [POST] /apps/v1/qrcode/create 接口的请求。</para> | ||
/// </summary> | ||
public class AppsQrcodeCreateV1Request : DouyinMicroAppRequest | ||
{ | ||
public static class Types | ||
{ | ||
public class Color | ||
{ | ||
/// <summary> | ||
/// 获取或设置 RGB 红色色值。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("r")] | ||
[System.Text.Json.Serialization.JsonPropertyName("r")] | ||
public byte Red { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置 RGB 绿色色值。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("g")] | ||
[System.Text.Json.Serialization.JsonPropertyName("g")] | ||
public byte Green { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置 RGB 蓝色色值。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("b")] | ||
[System.Text.Json.Serialization.JsonPropertyName("b")] | ||
public byte Blue { get; set; } | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// 获取或设置小程序 AppId。如果不指定将使用构造 <see cref="DouyinMicroAppClient"/> 时的 <see cref="DouyinMicroAppClientOptions.AppId"/> 参数。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("appid")] | ||
[System.Text.Json.Serialization.JsonPropertyName("appid")] | ||
public string? AppId { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置宿主名称。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("app_name")] | ||
[System.Text.Json.Serialization.JsonPropertyName("app_name")] | ||
public string? AppName { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置 URL 编码后的小程序启动路径。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("path")] | ||
[System.Text.Json.Serialization.JsonPropertyName("path")] | ||
public string? EncodedPath { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置二维码宽度(单位:像素)。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("width")] | ||
[System.Text.Json.Serialization.JsonPropertyName("width")] | ||
public int? Width { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置二维码线条颜色信息。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("line_color")] | ||
[System.Text.Json.Serialization.JsonPropertyName("line_color")] | ||
public Types.Color? LineColor { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置二维码背景颜色信息。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("background")] | ||
[System.Text.Json.Serialization.JsonPropertyName("background")] | ||
public Types.Color? BackgroundColor { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置是否展示小程序 Icon。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("set_icon")] | ||
[System.Text.Json.Serialization.JsonPropertyName("set_icon")] | ||
public bool? RequireSetIcon { get; set; } | ||
|
||
/// <summary> | ||
/// 获取或设置是否生成抖音码。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("is_circle_code")] | ||
[System.Text.Json.Serialization.JsonPropertyName("is_circle_code")] | ||
public bool? IsCircleCode { get; set; } | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Models/Apps/Qrcode/AppsQrcodeCreateV1Response.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/qrcode/create 接口的响应。</para> | ||
/// </summary> | ||
public class AppsQrcodeCreateV1Response : DouyinMicroAppResponse | ||
{ | ||
public static class Types | ||
{ | ||
public class Data | ||
{ | ||
/// <summary> | ||
/// 获取或设置经过 Base64 编码的二维码图片数据。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("img")] | ||
[System.Text.Json.Serialization.JsonPropertyName("img")] | ||
public string EncodingImageData { get; set; } = default!; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// 获取或设置返回数据。 | ||
/// </summary> | ||
[Newtonsoft.Json.JsonProperty("data")] | ||
[System.Text.Json.Serialization.JsonPropertyName("data")] | ||
public Types.Data Data { get; set; } = default!; | ||
} | ||
} |
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
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
17 changes: 17 additions & 0 deletions
17
...nt.ByteDance.MicroApp.UnitTests/ModelSamples/_/Apps/Qrcode/AppsQrcodeCreateV1Request.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,17 @@ | ||
{ | ||
"app_name": "douyin", | ||
"appid": "tt**********", | ||
"path": "{}", | ||
"width": 1000, | ||
"line_color": { | ||
"r": 0, | ||
"g": 0, | ||
"b": 0 | ||
}, | ||
"background": { | ||
"r": 0, | ||
"g": 0, | ||
"b": 0 | ||
}, | ||
"set_icon": false | ||
} |
7 changes: 7 additions & 0 deletions
7
...t.ByteDance.MicroApp.UnitTests/ModelSamples/_/Apps/Qrcode/AppsQrcodeCreateV1Response.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 @@ | ||
{ | ||
"err_no": 0, | ||
"err_msg": "", | ||
"data": { | ||
"img": "#######" | ||
} | ||
} |