mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-16 16:50:43 +08:00
feat(wxapi): 新增小程序硬件设备组相关接口
This commit is contained in:
parent
e7c70d58d8
commit
206aebc741
@ -51,28 +51,65 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGetUserPhoneNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
#region Midas
|
||||
#region B2BStore
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/getpayfororder 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/minigame/dev/api-backend/midas-payment/business.getPayForOrder.html </para>
|
||||
/// <para>异步调用 [POST] /wxa/business/getretailinfo 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/B2b_store_assistant.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessGetPayForOrderResponse> ExecuteWxaBusinessGetPayForOrderAsync(this WechatApiClient client, Models.WxaBusinessGetPayForOrderRequest request, CancellationToken cancellationToken = default)
|
||||
public static async Task<Models.WxaBusinessGetRetailInfoResponse> ExecuteWxaBusinessGetRetailInfoAsync(this WechatApiClient client, Models.WxaBusinessGetRetailInfoRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.AppId == null)
|
||||
request.AppId = client.Credentials.AppId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "getpayfororder")
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "getretailinfo")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGetPayForOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGetRetailInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/batchcreateretail 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/B2b_store_assistant.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessBatchCreateRetailResponse> ExecuteWxaBusinessBatchCreateRetailAsync(this WechatApiClient client, Models.WxaBusinessBatchCreateRetailRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "batchcreateretail")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessBatchCreateRetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/retailnotifybusiness 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/B2b_store_assistant.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessRetailNotifyBusinessResponse> ExecuteWxaBusinessRetailNotifyBusinessAsync(this WechatApiClient client, Models.WxaBusinessRetailNotifyBusinessRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "retailnotifybusiness")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessRetailNotifyBusinessResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -178,6 +215,113 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Group
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/group/createid 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/createIotGroupId.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessGroupCreateIdResponse> ExecuteWxaBusinessGroupCreateIdAsync(this WechatApiClient client, Models.WxaBusinessGroupCreateIdRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "group", "createid")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGroupCreateIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/group/adddevice 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/addIotGroupDevice.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessGroupAddDeviceResponse> ExecuteWxaBusinessGroupAddDeviceAsync(this WechatApiClient client, Models.WxaBusinessGroupAddDeviceRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "group", "adddevice")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGroupAddDeviceResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/group/removedevice 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/removeIotGroupDevice.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessGroupRemoveDeviceResponse> ExecuteWxaBusinessGroupRemoveDeviceAsync(this WechatApiClient client, Models.WxaBusinessGroupRemoveDeviceRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "group", "removedevice")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGroupRemoveDeviceResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/group/getinfo 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/getIotGroupInfo.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessGroupGetInfoResponse> ExecuteWxaBusinessGroupGetInfoAsync(this WechatApiClient client, Models.WxaBusinessGroupGetInfoRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "group", "getinfo")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGroupGetInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Internet
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/getuserencryptkey 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/internet/internet.getUserEncryptKey.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessGetUserEncryptKeyResponse> ExecuteWxaBusinessGetUserEncryptKeyAsync(this WechatApiClient client, Models.WxaBusinessGetUserEncryptKeyRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "getuserencryptkey")
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("openid", request.OpenId)
|
||||
.SetQueryParam("signature", request.Signature)
|
||||
.SetQueryParam("sig_method", request.SignMethod);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGetUserEncryptKeyResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region LiveBroadcast
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/applyliveinfo 接口。</para>
|
||||
@ -262,6 +406,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Midas
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/getpayfororder 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/minigame/dev/api-backend/midas-payment/business.getPayForOrder.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessGetPayForOrderResponse> ExecuteWxaBusinessGetPayForOrderAsync(this WechatApiClient client, Models.WxaBusinessGetPayForOrderRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.AppId == null)
|
||||
request.AppId = client.Credentials.AppId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "getpayfororder")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGetPayForOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Runtime
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/runtime/adddevice 接口。</para>
|
||||
@ -303,92 +472,5 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessRuntimePushAppMessageResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Internet
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/getuserencryptkey 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/internet/internet.getUserEncryptKey.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessGetUserEncryptKeyResponse> ExecuteWxaBusinessGetUserEncryptKeyAsync(this WechatApiClient client, Models.WxaBusinessGetUserEncryptKeyRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "getuserencryptkey")
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("openid", request.OpenId)
|
||||
.SetQueryParam("signature", request.Signature)
|
||||
.SetQueryParam("sig_method", request.SignMethod);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGetUserEncryptKeyResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region B2BStore
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/getretailinfo 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/B2b_store_assistant.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessGetRetailInfoResponse> ExecuteWxaBusinessGetRetailInfoAsync(this WechatApiClient client, Models.WxaBusinessGetRetailInfoRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "getretailinfo")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessGetRetailInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/batchcreateretail 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/B2b_store_assistant.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessBatchCreateRetailResponse> ExecuteWxaBusinessBatchCreateRetailAsync(this WechatApiClient client, Models.WxaBusinessBatchCreateRetailRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "batchcreateretail")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessBatchCreateRetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/retailnotifybusiness 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/B2b_store_assistant.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessRetailNotifyBusinessResponse> ExecuteWxaBusinessRetailNotifyBusinessAsync(this WechatApiClient client, Models.WxaBusinessRetailNotifyBusinessRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "wxa", "business", "retailnotifybusiness")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessRetailNotifyBusinessResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
@ -34,12 +34,19 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("template_id")]
|
||||
public string TemplateId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置设备型号 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("modelId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("modelId")]
|
||||
public string? ModelId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置设备序列号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sn")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sn")]
|
||||
public string SerialNumber { get; set; } = string.Empty;
|
||||
public string? SerialNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
|
@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/group/adddevice 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessGroupAddDeviceRequest : WechatApiRequest, IInferable<WxaBusinessGroupAddDeviceRequest, WxaBusinessGroupAddDeviceResponse>
|
||||
{
|
||||
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>
|
||||
/// 获取或设置设备组 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("group_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("group_id")]
|
||||
public string GroupId { 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>();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否强制添加。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("force_add")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("force_add")]
|
||||
public bool? IsForceAdd { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/group/adddevice 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessGroupAddDeviceResponse : 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("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!;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/group/createid 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessGroupCreateIdRequest : WechatApiRequest, IInferable<WxaBusinessGroupCreateIdRequest, WxaBusinessGroupCreateIdResponse>
|
||||
{
|
||||
/// <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("group_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("group_name")]
|
||||
public string GroupName { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/group/createid 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessGroupCreateIdResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置设备组 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("group_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("group_id")]
|
||||
public string GroupId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/group/getinfo 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessGroupGetInfoRequest : WechatApiRequest, IInferable<WxaBusinessGroupGetInfoRequest, WxaBusinessGroupGetInfoResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置设备组 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("group_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("group_id")]
|
||||
public string GroupId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/group/getinfo 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessGroupGetInfoResponse : 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("errcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errcode")]
|
||||
public int ErrorCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <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("model_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("model_type")]
|
||||
public string ModelType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置设备组名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("group_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("group_name")]
|
||||
public string GroupName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置设备列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("device_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("device_list")]
|
||||
public Types.Device[] DeviceList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/group/removedevice 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessGroupRemoveDeviceRequest : WechatApiRequest, IInferable<WxaBusinessGroupRemoveDeviceRequest, WxaBusinessGroupRemoveDeviceResponse>
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Device : WxaBusinessGroupAddDeviceRequest.Types.Device
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置设备组 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("group_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("group_id")]
|
||||
public string GroupId { 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>();
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/group/removedevice 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessGroupRemoveDeviceResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result : WxaBusinessGroupAddDeviceResponse.Types.Result
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("device_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("device_list")]
|
||||
public Types.Result[] ResultList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/getuserphonenumber 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessGetUserPhoneNumberRequest : WechatApiRequest
|
||||
public class WxaBusinessGetUserPhoneNumberRequest : WechatApiRequest, IInferable<WxaBusinessGetUserPhoneNumberRequest, WxaBusinessGetUserPhoneNumberResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置手机号获取凭证。
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"to_openid_list": ["OPENID_1", "OPENID_2"],
|
||||
{
|
||||
"to_openid_list": [ "OPENID_1", "OPENID_2" ],
|
||||
"sn": "XXXXXXX",
|
||||
"modelId": "XXXXXXX",
|
||||
"template_id": "TEMPLATE_ID",
|
||||
"page": "index",
|
||||
"miniprogram_state": "formal",
|
||||
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"group_id": "GROUP_ID",
|
||||
"device_list": [
|
||||
{
|
||||
"model_id": "MODEL_ID1",
|
||||
"sn": "SN1"
|
||||
},
|
||||
{
|
||||
"model_id": "MODEL_ID2",
|
||||
"sn": "SN2"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"device_list": [
|
||||
{
|
||||
"model_id": "MODEL_ID1",
|
||||
"sn": "SN1",
|
||||
"errcode": 0
|
||||
},
|
||||
{
|
||||
"model_id": "MODEL_ID2",
|
||||
"sn": "SN2",
|
||||
"errcode": 0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"group_name": "GROUP_NAME",
|
||||
"model_id": "MODEL_ID"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"group_id": "GROUP_ID"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"group_id": "GROUP_ID"
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"group_name": "GROUP_NAME",
|
||||
"model_id": "MODEL_ID",
|
||||
"model_type": "门禁机",
|
||||
"device_list": [
|
||||
{
|
||||
"model_id": "MODEL_ID1",
|
||||
"sn": "SN1"
|
||||
},
|
||||
{
|
||||
"model_id": "MODEL_ID2",
|
||||
"sn": "SN2"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"group_id": "GROUP_ID",
|
||||
"device_list": [
|
||||
{
|
||||
"model_id": "MODEL_ID1",
|
||||
"sn": "SN1"
|
||||
},
|
||||
{
|
||||
"model_id": "MODEL_ID2",
|
||||
"sn": "SN2"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"device_list": [
|
||||
{
|
||||
"model_id": "MODEL_ID1",
|
||||
"sn": "SN1",
|
||||
"errcode": 0
|
||||
},
|
||||
{
|
||||
"model_id": "MODEL_ID2",
|
||||
"sn": "SN2",
|
||||
"errcode": 0
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user