mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-12-22 03:19:55 +08:00
feat(tenpayv3): 新增查询爱心餐品牌信息接口
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
{
|
||||
public static class WechatTenpayClientExecuteLovefeastExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /lovefeast/brands/{brand_id} 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/lovefeast/brands/get-brand.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetLovefeastBrandByBrandIdResponse> ExecuteGetLovefeastBrandByBrandIdAsync(this WechatTenpayClient client, Models.GetLovefeastBrandByBrandIdRequest 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.Get, "lovefeast", "brands", request.BrandId);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.GetLovefeastBrandByBrandIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /lovefeast/brands/{brand_id} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetLovefeastBrandByBrandIdRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置品牌 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string BrandId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /lovefeast/brands/{brand_id} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetLovefeastBrandByBrandIdResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置捐赠数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("donate_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("donate_count")]
|
||||
public int DonateCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置供餐数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("consume_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("consume_count")]
|
||||
public int? ConsumeCount { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user