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
3f23f14e1b
commit
df135ddd31
@ -318,6 +318,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinLicenseCreateRenewOrderJobResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/submit_order_job 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ 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.CgibinLicenseSubmitOrderJobResponse> ExecuteCgibinLicenseSubmitOrderJobAsync(this WechatWorkClient client, Models.CgibinLicenseSubmitOrderJobRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "license", "submit_order_job")
|
||||
.SetQueryParam("provider_access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinLicenseSubmitOrderJobResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/list_order 接口。</para>
|
||||
/// <para>
|
||||
|
@ -0,0 +1,56 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/submit_order_job 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseSubmitOrderJobRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
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("new_expire_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("new_expire_time")]
|
||||
public long? NewExpireTimestamp { 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; } = 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_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/submit_order_job 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseSubmitOrderJobResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
|
||||
public string OrderId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"jobid": "wwxxx",
|
||||
"buyer_userid": "xxxx",
|
||||
"account_duration": {
|
||||
"months": 2,
|
||||
"new_expire_time":1700000000
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"order_id": "xxxx"
|
||||
}
|
Loading…
Reference in New Issue
Block a user