mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(work): 新增第三方应用开发多企业新购订单相关接口
This commit is contained in:
parent
d7c4d57c4e
commit
afb94293d9
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@ -124,6 +124,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinAgentMigrateToCustomizedAppResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/get_permissions 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/99052 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinAgentGetPermissionsResponse> ExecuteCgibinAgentGetPermissionsAsync(this WechatWorkClient client, Models.CgibinAgentGetPermissionsRequest 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", "agent", "get_permissions")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinAgentGetPermissionsResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
#region Workbench
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/set_workbench_template 接口。</para>
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@ -9,128 +9,6 @@ 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 Account
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/active_account 接口。</para>
|
||||
@ -318,7 +196,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region App
|
||||
#region AutoActive
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/set_auto_active_status 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95873 </para>
|
||||
@ -360,6 +238,210 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
}
|
||||
#endregion
|
||||
|
||||
#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 OrderJob
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/create_new_order_job 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98892 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseCreateNewOrderJobResponse> ExecuteCgibinLicenseCreateNewOrderJobAsync(this WechatWorkClient client, Models.CgibinLicenseCreateNewOrderJobRequest 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_job")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseCreateNewOrderJobResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/submit_new_order_job 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98892 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseSubmitNewOrderJobResponse> ExecuteCgibinLicenseSubmitNewOrderJobAsync(this WechatWorkClient client, Models.CgibinLicenseSubmitNewOrderJobRequest 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", "submit_new_order_job")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseSubmitNewOrderJobResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/new_order_job_result 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98892 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseNewOrderJobResultResponse> ExecuteCgibinLicenseNewOrderJobResultAsync(this WechatWorkClient client, Models.CgibinLicenseNewOrderJobResultRequest 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", "new_order_job_result")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseNewOrderJobResultResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/get_union_order 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98893 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseGetUnionOrderResponse> ExecuteCgibinLicenseGetUnionOrderAsync(this WechatWorkClient client, Models.CgibinLicenseGetUnionOrderRequest 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_union_order")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseGetUnionOrderResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/support_policy_query 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96515 </para>
|
||||
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/get_permissions 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentGetPermissionsRequest : WechatWorkRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/get_permissions 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentGetPermissionsResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置需要添加的权限列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_permissions")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_permissions")]
|
||||
public string[] AppPermissionList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/get_order 接口的响应。</para>
|
||||
@ -52,6 +52,7 @@
|
||||
public long? NewExpireTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单状态。
|
||||
/// </summary>
|
||||
|
@ -0,0 +1,78 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/create_new_order_job 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseCreateNewOrderJobRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Buy
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AccountCount : CgibinLicenseCreateNewOrderRequest.Types.AccountCount
|
||||
{
|
||||
}
|
||||
|
||||
public class AccountDuration : CgibinLicenseCreateNewOrderRequest.Types.AccountDuration
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { 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();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否自动激活。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("auto_active_status")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("auto_active_status")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))]
|
||||
public bool? IsAutoActive { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProviderAccessToken { 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("buy_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("buy_list")]
|
||||
public IList<Types.Buy> BuyList { get; set; } = new List<Types.Buy>();
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/create_new_order_job 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseCreateNewOrderJobResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class FailedCorp
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置企业 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { 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("errmsg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errmsg")]
|
||||
public string ErrorMessage { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置多企业新购任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string? JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置失败企业列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("invalid_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("invalid_list")]
|
||||
public Types.FailedCorp[]? FailedCorpList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/get_union_order 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseGetUnionOrderRequest : 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,128 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/get_union_order 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseGetUnionOrderResponse : 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_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_status")]
|
||||
public int OrderStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("price")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("price")]
|
||||
public int Price { 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("pay_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pay_time")]
|
||||
public long? PayTimestamp { get; set; }
|
||||
}
|
||||
|
||||
public class Buy
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AccountCount : CgibinLicenseGetOrderResponse.Types.Order.Types.AccountCount
|
||||
{
|
||||
}
|
||||
|
||||
public class AccountDuration : CgibinLicenseGetOrderResponse.Types.Order.Types.AccountDuration
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_id")]
|
||||
public string SubOrderId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = default!;
|
||||
|
||||
/// <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("order")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order")]
|
||||
public Types.Order Order { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置多企业购买信息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("buy_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("buy_list")]
|
||||
public Types.Buy[] BuyList { 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,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/new_order_job_result 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseNewOrderJobResultRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProviderAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置多企业新购任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/new_order_job_result 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseNewOrderJobResultResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class FailedCorp : CgibinLicenseCreateNewOrderJobResponse.Types.FailedCorp
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单创建结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
|
||||
public string? OrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置失败企业列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fail_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fail_list")]
|
||||
public Types.FailedCorp[]? FailedCorpList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/submit_new_order_job 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseSubmitNewOrderJobRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProviderAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置多企业新购任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置下单人成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("buyer_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("buyer_userid")]
|
||||
public string BuyerUserId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/submit_new_order_job 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseSubmitNewOrderJobResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置多企业新购任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"app_permissions": [ "xxx::xxx::xx" ]
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"buy_list": [
|
||||
{
|
||||
"corpid": "CORPID",
|
||||
"account_count": {
|
||||
"base_count": 100,
|
||||
"external_contact_count": 100
|
||||
},
|
||||
"account_duration": {
|
||||
"months": 2,
|
||||
"days": 20
|
||||
},
|
||||
"auto_active_status": 1
|
||||
}
|
||||
],
|
||||
"jobid": "JOBID"
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"jobid": "BUYJOBID",
|
||||
"invalid_list": [
|
||||
{
|
||||
"corpid": "CORPID",
|
||||
"errcode": 1,
|
||||
"errmsg": "xxx"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"order_id": "ORDERID",
|
||||
"limit": 1000,
|
||||
"cursor": "CURSOR"
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"order": {
|
||||
"order_id": "ORDERID",
|
||||
"order_type": 1,
|
||||
"order_status": 1,
|
||||
"price": 10000,
|
||||
"create_time": 150000000,
|
||||
"pay_time": 1550000000
|
||||
},
|
||||
"has_more": 1,
|
||||
"next_cursor": "CURSOR",
|
||||
"buy_list": [
|
||||
{
|
||||
"sub_order_id": "SUBORDERID",
|
||||
"corpid": "CORPID",
|
||||
"account_count": {
|
||||
"base_count": 100,
|
||||
"external_contact_count": 100
|
||||
},
|
||||
"account_duration": {
|
||||
"months": 2,
|
||||
"days": 20
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"jobid": "BUYJOBID"
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"status": 1,
|
||||
"order_id": "xxxx",
|
||||
"fail_list": [
|
||||
{
|
||||
"corpid": "CORPID",
|
||||
"errcode": 700400,
|
||||
"errmsg": "xxx"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"jobid": "BUYJOBID",
|
||||
"buyer_userid": "xxxx"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"jobid": "BUYJOBID"
|
||||
}
|
Loading…
Reference in New Issue
Block a user