diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteIntpRealNameExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteIntpRealNameExtensions.cs index d6c809c3..847cfdc9 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteIntpRealNameExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteIntpRealNameExtensions.cs @@ -54,5 +54,28 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// 异步调用 [POST] /intp/quickcheckstudentidentity 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task 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(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpQuickCheckStudentIdentityRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpQuickCheckStudentIdentityRequest.cs new file mode 100644 index 00000000..ef667b67 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpQuickCheckStudentIdentityRequest.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /intp/quickcheckstudentidentity 接口的请求。 + /// + public class IntpQuickCheckStudentIdentityRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置用户唯一标识。 + /// + [Newtonsoft.Json.JsonProperty("openid")] + [System.Text.Json.Serialization.JsonPropertyName("openid")] + public string OpenId { get; set; } = string.Empty; + + /// + /// 获取或设置用户授权查询 Code。 + /// + [Newtonsoft.Json.JsonProperty("wx_studentcheck_code")] + [System.Text.Json.Serialization.JsonPropertyName("wx_studentcheck_code")] + public string CheckCode { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpQuickCheckStudentIdentityResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpQuickCheckStudentIdentityResponse.cs new file mode 100644 index 00000000..f31c224c --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpQuickCheckStudentIdentityResponse.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /intp/quickcheckstudentidentity 接口的响应。 + /// + public class IntpQuickCheckStudentIdentityResponse : WechatApiResponse + { + /// + /// 获取或设置绑定状态。 + /// + [Newtonsoft.Json.JsonProperty("bind_status")] + [System.Text.Json.Serialization.JsonPropertyName("bind_status")] + public int BindStatus { get; set; } + + /// + /// 获取或设置是否是学生。 + /// + [Newtonsoft.Json.JsonProperty("is_student")] + [System.Text.Json.Serialization.JsonPropertyName("is_student")] + public bool IsStudent { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpRealNameCheckRealNameInfoResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpRealNameCheckRealNameInfoResponse.cs index 788688cd..5e889c11 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpRealNameCheckRealNameInfoResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpRealNameCheckRealNameInfoResponse.cs @@ -1,9 +1,9 @@ -namespace SKIT.FlurlHttpClient.Wechat.Api.Models +namespace SKIT.FlurlHttpClient.Wechat.Api.Models { /// /// 表示 [POST] /intp/realname/checkrealnameinfo 接口的响应。 /// - public class IntpRealNameCheckRealNameInfoResponse : IntpMarketCodeActiveCodeQueryResponse + public class IntpRealNameCheckRealNameInfoResponse : WechatApiResponse { /// /// 获取或设置 OpenId 验证结果,使用分号分隔。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpRealNameGetAuthUrlResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpRealNameGetAuthUrlResponse.cs index 0d40743c..65f68f3f 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpRealNameGetAuthUrlResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/IntpRealName/IntpRealNameGetAuthUrlResponse.cs @@ -1,9 +1,9 @@ -namespace SKIT.FlurlHttpClient.Wechat.Api.Models +namespace SKIT.FlurlHttpClient.Wechat.Api.Models { /// /// 表示 [POST] /intp/realname/getauthurl 接口的响应。 /// - public class IntpRealNameGetAuthUrlResponse : IntpMarketCodeActiveCodeQueryResponse + public class IntpRealNameGetAuthUrlResponse : WechatApiResponse { /// /// 获取或设置授权链接。 diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/IntpRealName/IntpQuickCheckStudentIdentityRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/IntpRealName/IntpQuickCheckStudentIdentityRequest.json new file mode 100644 index 00000000..81653482 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/IntpRealName/IntpQuickCheckStudentIdentityRequest.json @@ -0,0 +1,4 @@ +{ + "openid": "", + "wx_studentcheck_code": "" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/IntpRealName/IntpQuickCheckStudentIdentityResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/IntpRealName/IntpQuickCheckStudentIdentityResponse.json new file mode 100644 index 00000000..30c14411 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/IntpRealName/IntpQuickCheckStudentIdentityResponse.json @@ -0,0 +1,6 @@ +{ + "errcode": 0, + "errmsg": "ok", + "bind_status": 1, + "is_student": true +}