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
f0d19e79a0
commit
45c8d6d024
@ -289,6 +289,47 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinKfCustomerCancelUpgradeServiceResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/kf/customer/batchget 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/95159 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/95149 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinKfCustomerBatchGetResponse> ExecuteCgibinKfCustomerBatchGetAsync(this WechatWorkClient client, Models.CgibinKfCustomerBatchGetRequest 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", "kf", "customer", "batchget")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinKfCustomerBatchGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/kf/get_corp_qualification 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/95153 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinKfGetCorpQualificationResponse> ExecuteCgibinKfGetCorpQualificationAsync(this WechatWorkClient client, Models.CgibinKfGetCorpQualificationRequest 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", "kf", "get_corp_qualification")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinKfGetCorpQualificationResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/kf/get_corp_qualification 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfGetCorpQualificationRequest : WechatWorkRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/kf/get_corp_qualification 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfGetCorpQualificationResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置是否已绑定视频号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wechat_channels_binding")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wechat_channels_binding")]
|
||||
public bool IsWechatChannelsBound { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/kf/customer/batchget 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfCustomerBatchGetRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置外部联系人账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_userid_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_userid_list")]
|
||||
public IList<string> ExternalUserIdList { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/kf/customer/batchget 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfCustomerBatchGetResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Customer
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置外部联系人账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
|
||||
public string ExternalUserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置昵称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("nickname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("nickname")]
|
||||
public string Nickname { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置头像 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("avatar")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("avatar")]
|
||||
public string AvatarUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置性别。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("gender")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("gender")]
|
||||
public int Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户 UnionId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unionid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unionid")]
|
||||
public string? UnionId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置客户列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("customer_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("customer_list")]
|
||||
public Types.Customer[] CustomerLsit { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置无效的外部联系人账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("invalid_external_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("invalid_external_userid")]
|
||||
public string[] InvalidExternalUserIdList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"wechat_channels_binding": true
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"external_userid_list": [
|
||||
"wmxxxxxxxxxxxxxxxxxxxxxx",
|
||||
"zhangsan"
|
||||
]
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"customer_list": [
|
||||
{
|
||||
"external_userid": "wmxxxxxxxxxxxxxxxxxxxxxx",
|
||||
"nickname": "张三",
|
||||
"avatar": "http://xxxxx",
|
||||
"gender": 1,
|
||||
"unionid": "oxasdaosaosdasdasdasd"
|
||||
}
|
||||
],
|
||||
"invalid_external_userid": [
|
||||
"zhangsan"
|
||||
]
|
||||
}
|
@ -0,0 +1 @@
|
||||
{}
|
Loading…
Reference in New Issue
Block a user