mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-15 04:48:16 +08:00
feat(work): 新增班级收款相关接口
This commit is contained in:
@@ -94,7 +94,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
}
|
||||
|
||||
#region User
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/school/user/get 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92337 </para>
|
||||
@@ -639,5 +638,47 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinSchoolLivingGetUnwatchStatisticsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Payment
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/school/get_payment_result 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94470 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinSchoolGetPaymentResultResponse> ExecuteCgibinSchoolGetPaymentResultAsync(this WechatWorkClient client, Models.CgibinSchoolGetPaymentResultRequest 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", "school", "get_payment_result")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinSchoolGetPaymentResultResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/school/get_trade 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94471 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinSchoolGetTradeResponse> ExecuteCgibinSchoolGetTradeAsync(this WechatWorkClient client, Models.CgibinSchoolGetTradeRequest 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", "school", "get_trade")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinSchoolGetTradeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/school/get_payment_result 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinSchoolGetPaymentResultRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置收款项目 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payment_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payment_id")]
|
||||
public string PaymentId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/school/get_payment_result 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinSchoolGetPaymentResultResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class PaymentResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置学生账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("student_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("student_userid")]
|
||||
public string StudentUserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置家长账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_parent_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_parent_userid")]
|
||||
public string? ParentUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置付款状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_state")]
|
||||
public int TradeState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_no")]
|
||||
public string TradeNumber { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置收款项目名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("project_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("project_name")]
|
||||
public string ProjectName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置收款金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public int Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置付款结果列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payment_result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payment_result")]
|
||||
public Types.PaymentResult[] PaymentResultList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/school/get_trade 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinSchoolGetTradeRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置收款项目 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payment_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payment_id")]
|
||||
public string PaymentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_no")]
|
||||
public string TradeNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/school/get_trade 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinSchoolGetTradeResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信交易单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string TransactionId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置交易时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pay_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pay_time")]
|
||||
public long PayTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user