mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(work): 新增接口调用许可民生减免条件查询接口
This commit is contained in:
parent
ca18ed6cde
commit
4d9163ded1
@ -75,5 +75,25 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseGetAutoActiveStatusResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/license/support_policy_query 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96515 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLicenseSupportPolicyQueryResponse> ExecuteCgibinLicenseSupportPolicyQueryAsync(this WechatWorkClient client, Models.CgibinLicenseSupportPolicyQueryRequest 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.Post, "cgi-bin", "license", "support_policy_query")
|
||||
.SetQueryParam("access_token", request.ProviderAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLicenseSupportPolicyQueryResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/support_policy_query 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseSupportPolicyQueryRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProviderAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/license/support_policy_query 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLicenseSupportPolicyQueryResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置查询结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("query_result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("query_result")]
|
||||
public int QueryResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置被查询企业不符合减免条件的原因对应的错误码列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unsatisfied_reason")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unsatisfied_reason")]
|
||||
public int[]? UnsatisfiedReasonCodeList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"corpid": "wwxxx"
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"query_result": 1,
|
||||
"unsatisfied_reason": [701090, 701091]
|
||||
}
|
Loading…
Reference in New Issue
Block a user