mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-17 10:41:58 +08:00
feat(wxapi): 新增代商家管理小程序查询开放平台帐号是否与小程序同主体接口
This commit is contained in:
parent
af22620caf
commit
b3c8eac6ad
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -108,5 +108,25 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
|
|
||||||
return await client.SendRequestWithJsonAsync<Models.CgibinOpenGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
return await client.SendRequestWithJsonAsync<Models.CgibinOpenGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [GET] /cgi-bin/open/sameentity 接口。</para>
|
||||||
|
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/basic-info-management/getBindOpenAccountEntity.html </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinOpenSameEntityResponse> ExecuteCgibinOpenSameEntityAsync(this WechatApiClient client, Models.CgibinOpenSameEntityRequest 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.Get, "cgi-bin", "open", "sameentity")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.CgibinOpenSameEntityResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [GET] /cgi-bin/open/sameentity 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinOpenSameEntityRequest : WechatApiRequest, IInferable<CgibinOpenSameEntityRequest, CgibinOpenSameEntityResponse>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [GET] /cgi-bin/open/sameentity 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinOpenSameEntityResponse : WechatApiResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置是否相同主体。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("same_entity")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("same_entity")]
|
||||||
|
public bool IsSameEntity { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"same_entity": false,
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user