mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-16 07:59:44 +08:00
feat(work): 新增接口调用许可订单管理相关接口
This commit is contained in:
parent
0521c968d8
commit
c3d5118974
@ -57,8 +57,8 @@
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
|
||||
public string? AuthorizerCorpId { get; set; }
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId")]
|
||||
public string AuthorizerCorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置许可自动激活场景值。
|
||||
|
@ -15,8 +15,8 @@
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
|
||||
public string? AuthorizerCorpId { get; set; }
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId")]
|
||||
public string AuthorizerCorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
@ -27,7 +27,7 @@
|
||||
/// <summary>
|
||||
/// 获取或设置服务商内下单用户 UserId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("BuyerUserId", IsNullable = true)]
|
||||
public string? BuyerUserId { get; set; }
|
||||
[System.Xml.Serialization.XmlElement("BuyerUserId")]
|
||||
public string BuyerUserId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
@ -15,8 +15,8 @@
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
|
||||
public string? AuthorizerCorpId { get; set; }
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId")]
|
||||
public string AuthorizerCorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
|
@ -9,6 +9,128 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinLicenseExtensions
|
||||
{
|
||||
#region Order
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/create_new_order 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95644 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseCreateNewOrderResponse> ExecuteCgibinLicenseCreateNewOrderAsync(this WechatWorkClient client, Models.CgibinLicenseCreateNewOrderRequest 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, "cgi-bin", "license", "create_new_order")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseCreateNewOrderResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/create_renew_order_job 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95646 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseCreateRenewOrderJobResponse> ExecuteCgibinLicenseCreateRenewOrderJobAsync(this WechatWorkClient client, Models.CgibinLicenseCreateRenewOrderJobRequest 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, "cgi-bin", "license", "create_renew_order_job")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseCreateRenewOrderJobResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/list_order 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95647 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseListOrderResponse> ExecuteCgibinLicenseListOrderAsync(this WechatWorkClient client, Models.CgibinLicenseListOrderRequest 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, "cgi-bin", "license", "list_order")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseListOrderResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/get_order 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95648 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseGetOrderResponse> ExecuteCgibinLicenseGetOrderAsync(this WechatWorkClient client, Models.CgibinLicenseGetOrderRequest 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, "cgi-bin", "license", "get_order")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseGetOrderResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/list_order_account 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95649 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseListOrderAccountResponse> ExecuteCgibinLicenseListOrderAccountAsync(this WechatWorkClient client, Models.CgibinLicenseListOrderAccountRequest 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, "cgi-bin", "license", "list_order_account")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseListOrderAccountResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/cancel_order 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96106 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseCancelOrderResponse> ExecuteCgibinLicenseCancelOrderAsync(this WechatWorkClient client, Models.CgibinLicenseCancelOrderRequest 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, "cgi-bin", "license", "cancel_order")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseCancelOrderResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region App
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/get_app_license_info 接口。</para>
|
||||
@ -28,7 +150,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "license", "get_app_license_info")
|
||||
.SetQueryParam("access_token", request.ProviderAccessToken);
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseGetAppLicenseInfoResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
@ -50,7 +172,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "license", "set_auto_active_status")
|
||||
.SetQueryParam("access_token", request.ProviderAccessToken);
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseSetAutoActiveStatusResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
@ -70,7 +192,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "license", "get_auto_active_status")
|
||||
.SetQueryParam("access_token", request.ProviderAccessToken);
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseGetAutoActiveStatusResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
@ -91,7 +213,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "license", "support_policy_query")
|
||||
.SetQueryParam("access_token", request.ProviderAccessToken);
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseSupportPolicyQueryResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/cancel_order 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseCancelOrderRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProviderAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
|
||||
public string OrderId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/cancel_order 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseCancelOrderResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/create_new_order 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseCreateNewOrderRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AccountCount
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置基础帐号个数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("base_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("base_count")]
|
||||
public int? BaseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置互通帐号个数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_contact_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_contact_count")]
|
||||
public int? ExternalContactCount { get; set; }
|
||||
}
|
||||
|
||||
public class AccountDuration
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置购买的月数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("months")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("months")]
|
||||
public int? Months { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置购买的天数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("days")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("days")]
|
||||
public int? Days { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProviderAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置下单人成员 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("buyer_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("buyer_userid")]
|
||||
public string BuyerUserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账号个数信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("account_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("account_count")]
|
||||
public Types.AccountCount AccountCount { get; set; } = new Types.AccountCount();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账号时长信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("account_duration")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("account_duration")]
|
||||
public Types.AccountDuration AccountDuration { get; set; } = new Types.AccountDuration();
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/create_new_order 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseCreateNewOrderResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
|
||||
public string OrderId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/create_renew_order_job 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseCreateRenewOrderJobRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Account
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置续期企业的成员 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置续期帐号类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProviderAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string? JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置续期的帐号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("account_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("account_list")]
|
||||
public IList<Types.Account> AccountList { get; set; } = new List<Types.Account>();
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/create_renew_order_job 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseCreateRenewOrderJobResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Account
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置错误码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errcode")]
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errmsg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errmsg")]
|
||||
public string? ErrorMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置续期企业的成员 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置续期帐号类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置无效的帐号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("invalid_account_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("invalid_account_list")]
|
||||
public Types.Account[] InvalidAccountList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/get_order 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseGetOrderRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProviderAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
|
||||
public string OrderId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/get_order 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseGetOrderResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Order : CgibinLicenseListOrderResponse.Types.Order
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AccountCount
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置基础帐号个数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("base_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("base_count")]
|
||||
public int BaseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置互通帐号个数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_contact_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_contact_count")]
|
||||
public int ExternalContactCount { get; set; }
|
||||
}
|
||||
|
||||
public class AccountDuration
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置购买的月数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("months")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("months")]
|
||||
public int? Months { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置购买的天数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("days")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("days")]
|
||||
public int? Days { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置新过期时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("new_expire_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("new_expire_time")]
|
||||
public long? NewExpireTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取或设置订单状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_status")]
|
||||
public int OrderStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置客户企业 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("price")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("price")]
|
||||
public int Price { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账号个数信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("account_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("account_count")]
|
||||
public Types.AccountCount AccountCount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账号时长信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("account_duration")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("account_duration")]
|
||||
public Types.AccountDuration AccountDuration { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置创建时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("create_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
|
||||
public long CreateTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置支付时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pay_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pay_time")]
|
||||
public long? PayTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order")]
|
||||
public Types.Order Order { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/list_order_account 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseListOrderAccountRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProviderAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
|
||||
public string OrderId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/list_order_account 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseListOrderAccountResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Account
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置帐号激活码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("active_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("active_code")]
|
||||
public string ActiveCode { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员的 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string? UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置帐号类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("account_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("account_list")]
|
||||
public Types.Account[] AccountList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))]
|
||||
public bool HasMore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/list_order 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseListOrderRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProviderAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = string.Empty;
|
||||
|
||||
/// <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("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/list_order 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseListOrderResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Order
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
|
||||
public string OrderId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_type")]
|
||||
public int OrderType { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_list")]
|
||||
public Types.Order[] OrderList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))]
|
||||
public bool HasMore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"corpid": "CORPID",
|
||||
"order_id": "xxxxx"
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"corpid": "wwxxx",
|
||||
"buyer_userid": "xxxx",
|
||||
"account_count": {
|
||||
"base_count": 100,
|
||||
"external_contact_count": 100
|
||||
},
|
||||
"account_duration": {
|
||||
"months": 2,
|
||||
"days": 20
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"order_id": "xxxx"
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"corpid": "wwxxx",
|
||||
"account_list": [
|
||||
{
|
||||
"userid": "userid1",
|
||||
"type": 1
|
||||
}
|
||||
],
|
||||
"jobid": "JOBID"
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"jobid": "xxxx",
|
||||
"invalid_account_list": [
|
||||
{
|
||||
"errcode": 1,
|
||||
"errmsg": "xxx",
|
||||
"userid": "userid1",
|
||||
"type": 1
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"order_id": "xxxxx"
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"order": {
|
||||
"order_id": "xxxxx",
|
||||
"order_type": 1,
|
||||
"order_status": 1,
|
||||
"corpid": "wpxxxx",
|
||||
"price": 10000,
|
||||
"account_count": {
|
||||
"base_count": 100,
|
||||
"external_contact_count": 100
|
||||
},
|
||||
"account_duration": {
|
||||
"months": 2,
|
||||
"days": 20,
|
||||
"new_expire_time": 1700000000
|
||||
},
|
||||
"create_time": 150000000,
|
||||
"pay_time": 1550000000
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"order_id": "XXXXXXXX",
|
||||
"limit": 1000,
|
||||
"cursor": "xxxx"
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"next_cursor": "xxxx",
|
||||
"has_more": 1,
|
||||
"account_list": [
|
||||
{
|
||||
"active_code": "code1",
|
||||
"userid": "XXX",
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"active_code": "code2",
|
||||
"userid": "XXX",
|
||||
"type": 2
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"corpid": "xxxxx",
|
||||
"start_time": 1500000000,
|
||||
"end_time": 1600000000,
|
||||
"cursor": "xxx",
|
||||
"limit": 10
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"next_cursor": "xxx",
|
||||
"has_more": 1,
|
||||
"order_list": [
|
||||
{
|
||||
"order_id": "xxx",
|
||||
"order_type": 1
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user