feat(wxapi): 新增小程序硬件设备激活相关接口

This commit is contained in:
Fu Diwei
2023-12-22 13:55:19 +08:00
parent a3d2404149
commit f778449d1b
13 changed files with 420 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/business/license/activedevice 接口的请求。</para>
/// </summary>
public class WxaBusinessLicenseActiveDeviceRequest : WechatApiRequest, IInferable<WxaBusinessLicenseActiveDeviceRequest, WxaBusinessLicenseActiveDeviceResponse>
{
public static class Types
{
public class Device
{
/// <summary>
/// 获取或设置设备型号 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("model_id")]
[System.Text.Json.Serialization.JsonPropertyName("model_id")]
public string ModelId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sn")]
[System.Text.Json.Serialization.JsonPropertyName("sn")]
public string SerialNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置激活码序号。
/// </summary>
[Newtonsoft.Json.JsonProperty("active_number")]
[System.Text.Json.Serialization.JsonPropertyName("active_number")]
public int ActiveNumber { get; set; }
}
}
/// <summary>
/// 获取或设置设备列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_list")]
[System.Text.Json.Serialization.JsonPropertyName("device_list")]
public IList<Types.Device> DeviceList { get; set; } = new List<Types.Device>();
/// <summary>
/// 获取或设置资源包类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("pkg_type")]
[System.Text.Json.Serialization.JsonPropertyName("pkg_type")]
public int PackageType { get; set; }
}
}

View File

@@ -0,0 +1,49 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/business/license/activedevice 接口的响应。</para>
/// </summary>
public class WxaBusinessLicenseActiveDeviceResponse : WechatApiResponse
{
public static class Types
{
public class Result
{
/// <summary>
/// 获取或设置设备型号 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("model_id")]
[System.Text.Json.Serialization.JsonPropertyName("model_id")]
public string ModelId { get; set; } = default!;
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sn")]
[System.Text.Json.Serialization.JsonPropertyName("sn")]
public string SerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置设备过期时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("expire_time")]
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
public long? ExpireTimestamp { get; set; }
/// <summary>
/// 获取或设置错误码。
/// </summary>
[Newtonsoft.Json.JsonProperty("errcode")]
[System.Text.Json.Serialization.JsonPropertyName("errcode")]
public int ErrorCode { get; set; }
}
}
/// <summary>
/// 获取或设置结果列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_list")]
[System.Text.Json.Serialization.JsonPropertyName("device_list")]
public Types.Result[] ResultList { get; set; } = default!;
}
}

View File

@@ -0,0 +1,37 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/business/license/getdeviceinfo 接口的请求。</para>
/// </summary>
public class WxaBusinessLicenseGetDeviceInfoRequest : WechatApiRequest, IInferable<WxaBusinessLicenseGetDeviceInfoRequest, WxaBusinessLicenseGetDeviceInfoResponse>
{
public static class Types
{
public class Device
{
/// <summary>
/// 获取或设置设备型号 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("model_id")]
[System.Text.Json.Serialization.JsonPropertyName("model_id")]
public string ModelId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sn")]
[System.Text.Json.Serialization.JsonPropertyName("sn")]
public string SerialNumber { get; set; } = string.Empty;
}
}
/// <summary>
/// 获取或设置设备列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_list")]
[System.Text.Json.Serialization.JsonPropertyName("device_list")]
public IList<Types.Device> DeviceList { get; set; } = new List<Types.Device>();
}
}

View File

@@ -0,0 +1,42 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/business/license/getdeviceinfo 接口的响应。</para>
/// </summary>
public class WxaBusinessLicenseGetDeviceInfoResponse : WechatApiResponse
{
public static class Types
{
public class Device
{
/// <summary>
/// 获取或设置设备型号 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("model_id")]
[System.Text.Json.Serialization.JsonPropertyName("model_id")]
public string ModelId { get; set; } = default!;
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sn")]
[System.Text.Json.Serialization.JsonPropertyName("sn")]
public string SerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置设备过期时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("expire_time")]
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
public long? ExpireTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置设备列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_list")]
[System.Text.Json.Serialization.JsonPropertyName("device_list")]
public Types.Device[] DeviceList { get; set; } = default!;
}
}

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/business/license/getpkglist 接口的请求。</para>
/// </summary>
public class WxaBusinessLicenseGetPackageListRequest : WechatApiRequest, IInferable<WxaBusinessLicenseGetPackageListRequest, WxaBusinessLicenseGetPackageListResponse>
{
/// <summary>
/// 获取或设置资源包类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("pkg_type")]
[System.Text.Json.Serialization.JsonPropertyName("pkg_type")]
public int PackageType { get; set; }
}
}

View File

@@ -0,0 +1,77 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/business/license/getpkglist 接口的响应。</para>
/// </summary>
public class WxaBusinessLicenseGetPackageListResponse : WechatApiResponse
{
public static class Types
{
public class Package
{
/// <summary>
/// 获取或设置资源包 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("pkg_id")]
[System.Text.Json.Serialization.JsonPropertyName("pkg_id")]
public string PackageId { get; set; } = default!;
/// <summary>
/// 获取或设置资源包类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("pkg_type")]
[System.Text.Json.Serialization.JsonPropertyName("pkg_type")]
public int PackageType { get; set; }
/// <summary>
/// 获取或设置资源包状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("pkg_status")]
[System.Text.Json.Serialization.JsonPropertyName("pkg_status")]
public int PackageStatus { get; set; }
/// <summary>
/// 获取或设置下单时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("start_time")]
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
public long StartTimestamp { get; set; }
/// <summary>
/// 获取或设置过期时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("end_time")]
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
public long EndTimestamp { get; set; }
/// <summary>
/// 获取或设置已使用额度。
/// </summary>
[Newtonsoft.Json.JsonProperty("used")]
[System.Text.Json.Serialization.JsonPropertyName("used")]
public int UsedQuota { get; set; }
/// <summary>
/// 获取或设置资源包总量。
/// </summary>
[Newtonsoft.Json.JsonProperty("all")]
[System.Text.Json.Serialization.JsonPropertyName("all")]
public int TotalQuota { get; set; }
}
}
/// <summary>
/// 获取或设置资源包列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("pkg_list")]
[System.Text.Json.Serialization.JsonPropertyName("pkg_list")]
public Types.Package[] PackageList { get; set; } = default!;
/// <summary>
/// 获取或设置最大激活码序号。
/// </summary>
[Newtonsoft.Json.JsonProperty("max_active_number")]
[System.Text.Json.Serialization.JsonPropertyName("max_active_number")]
public int? MaxActiveNumber { get; set; }
}
}