mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-03-10 00:13:36 +08:00
feat(wxapi): 新增微信小店获取关联账号企微 ID 接口
This commit is contained in:
@@ -5639,6 +5639,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region ECWecom
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/wecom/get_wecom_id 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/wecom/getwecomid.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECWecomGetWecomIdResponse> ExecuteChannelsECWecomGetWecomIdAsync(this WechatApiClient client, Models.ChannelsECWecomGetWecomIdRequest 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, "channels", "ec", "wecom", "get_wecom_id")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECWecomGetWecomIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ECWindow
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/window/product/add 接口。</para>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/wecom/get_wecom_id 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECWecomGetWecomIdRequest : WechatApiRequest, IInferable<ChannelsECWecomGetWecomIdRequest, ChannelsECWecomGetWecomIdResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corp_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corp_id")]
|
||||
public string CorpId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_id")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/wecom/get_wecom_id 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECWecomGetWecomIdResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wecom_corp_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wecom_corp_id")]
|
||||
public string WecomAppId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信账号 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wecom_user_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wecom_user_id")]
|
||||
public string WecomUserId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置返回数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user