mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-17 19:37:35 +08:00
feat(wxapi): 新增快速获取学生身份接口
This commit is contained in:
parent
19c9e66de7
commit
06935ff4cf
@ -54,5 +54,28 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.IntpRealNameCheckRealNameInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /intp/quickcheckstudentidentity 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/student.html#_5-2-%E5%BF%AB%E9%80%9F%E8%8E%B7%E5%8F%96%E5%AD%A6%E7%94%9F%E8%BA%AB%E4%BB%BDAPI ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.IntpQuickCheckStudentIdentityResponse> ExecuteIntpQuickCheckStudentIdentityAsync(this WechatApiClient client, Models.IntpQuickCheckStudentIdentityRequest 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, "intp", "quickcheckstudentidentity")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.IntpQuickCheckStudentIdentityResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /intp/quickcheckstudentidentity 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class IntpQuickCheckStudentIdentityRequest : WechatApiRequest, IInferable<IntpQuickCheckStudentIdentityRequest, IntpQuickCheckStudentIdentityResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置用户唯一标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户授权查询 Code。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wx_studentcheck_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wx_studentcheck_code")]
|
||||
public string CheckCode { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /intp/quickcheckstudentidentity 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class IntpQuickCheckStudentIdentityResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置绑定状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bind_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bind_status")]
|
||||
public int BindStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否是学生。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("is_student")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("is_student")]
|
||||
public bool IsStudent { get; set; }
|
||||
}
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /intp/realname/checkrealnameinfo 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class IntpRealNameCheckRealNameInfoResponse : IntpMarketCodeActiveCodeQueryResponse
|
||||
public class IntpRealNameCheckRealNameInfoResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 OpenId 验证结果,使用分号分隔。
|
||||
|
@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /intp/realname/getauthurl 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class IntpRealNameGetAuthUrlResponse : IntpMarketCodeActiveCodeQueryResponse
|
||||
public class IntpRealNameGetAuthUrlResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置授权链接。
|
||||
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"openid": "",
|
||||
"wx_studentcheck_code": ""
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"bind_status": 1,
|
||||
"is_student": true
|
||||
}
|
Loading…
Reference in New Issue
Block a user