mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 10:08:20 +08:00
feat(work): 新增接待人员管理相关接口
This commit is contained in:
@@ -1540,7 +1540,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/get_intercept_rule_list 接口。</para>
|
||||
/// <para>异步调用 [GET] /cgi-bin/externalcontact/get_intercept_rule_list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/95097 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/95130 </para>
|
||||
/// </summary>
|
||||
@@ -1554,10 +1554,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "externalcontact", "get_intercept_rule_list")
|
||||
.CreateRequest(request, HttpMethod.Get, "cgi-bin", "externalcontact", "get_intercept_rule_list")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactGetInterceptRuleListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactGetInterceptRuleListResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -32,7 +32,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/kf/account/list 接口。</para>
|
||||
/// <para>异步调用 [GET] /cgi-bin/kf/account/list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94661 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94691 </para>
|
||||
/// </summary>
|
||||
@@ -46,7 +46,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "kf", "account", "list")
|
||||
.CreateRequest(request, HttpMethod.Get, "cgi-bin", "kf", "account", "list")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinKfAccountListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
@@ -115,5 +115,71 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinKfAddContactWayResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Servicer
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/kf/servicer/add 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94646 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94695 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinKfServicerAddResponse> ExecuteCgibinKfServicerAddAsync(this WechatWorkClient client, Models.CgibinKfServicerAddRequest 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", "servicer", "add")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinKfServicerAddResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/kf/servicer/del 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94647 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94696 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinKfServicerDeleteResponse> ExecuteCgibinKfServicerDeleteAsync(this WechatWorkClient client, Models.CgibinKfServicerDeleteRequest 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", "servicer", "del")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinKfServicerDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/kf/servicer/list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94645 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94697 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinKfServicerListResponse> ExecuteCgibinKfServicerListAsync(this WechatWorkClient client, Models.CgibinKfServicerListRequest 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", "servicer", "list")
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("open_kfid", request.OpenKfId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinKfServicerListResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/get_intercept_rule_list 接口的请求。</para>
|
||||
/// <para>表示 [GET] /cgi-bin/externalcontact/get_intercept_rule_list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactGetInterceptRuleListRequest : WechatWorkRequest
|
||||
{
|
||||
|
@@ -1,7 +1,7 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/get_intercept_rule_list 接口的响应。</para>
|
||||
/// <para>表示 [GET] /cgi-bin/externalcontact/get_intercept_rule_list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactGetInterceptRuleListResponse : WechatWorkResponse
|
||||
{
|
||||
|
@@ -1,7 +1,7 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/kf/account/list 接口的请求。</para>
|
||||
/// <para>表示 [GET] /cgi-bin/kf/account/list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfAccountListRequest : WechatWorkRequest
|
||||
{
|
||||
|
@@ -1,7 +1,7 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/kf/account/list 接口的响应。</para>
|
||||
/// <para>表示 [GET] /cgi-bin/kf/account/list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfAccountListResponse : WechatWorkResponse
|
||||
{
|
||||
|
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/kf/servicer/add 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfServicerAddRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置客服账号 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("open_kfid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("open_kfid")]
|
||||
public string OpenKfId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置接待人员的 UserId 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid_list")]
|
||||
public IList<string> UserIdList { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/kf/servicer/add 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfServicerAddResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置接待人员的 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errcode")]
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errmsg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errmsg")]
|
||||
public string ErrorMessage { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result_list")]
|
||||
public Types.Result[] ResultList { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/kf/servicer/del 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfServicerDeleteRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置客服账号 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("open_kfid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("open_kfid")]
|
||||
public string OpenKfId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置接待人员的 UserId 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid_list")]
|
||||
public IList<string> UserIdList { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/kf/servicer/del 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfServicerDeleteResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result : CgibinKfServicerAddResponse.Types.Result
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result_list")]
|
||||
public Types.Result[] ResultList { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/kf/servicer/list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfServicerListRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置客服账号 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string OpenKfId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,35 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/kf/servicer/list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinKfServicerListResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Servicer
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置接待人员的 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置接待状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置接待人员列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("servicer_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("servicer_list")]
|
||||
public Types.Servicer[] ServicerList { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"open_kfid": "kfxxxxxxxxxxxxxx",
|
||||
"userid_list": [
|
||||
"zhangsan",
|
||||
"lisi"
|
||||
]
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"result_list": [
|
||||
{
|
||||
"userid": "zhangsan",
|
||||
"errcode": 0,
|
||||
"errmsg": "success"
|
||||
},
|
||||
{
|
||||
"userid": "lisi",
|
||||
"errcode": 0,
|
||||
"errmsg": "ignored"
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"open_kfid": "kfxxxxxxxxxxxxxx",
|
||||
"userid_list": [
|
||||
"zhangsan",
|
||||
"lisi"
|
||||
]
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"result_list": [
|
||||
{
|
||||
"userid": "zhangsan",
|
||||
"errcode": 0,
|
||||
"errmsg": "success"
|
||||
},
|
||||
{
|
||||
"userid": "lisi",
|
||||
"errcode": 0,
|
||||
"errmsg": "ignored"
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1 @@
|
||||
{}
|
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"servicer_list": [
|
||||
{
|
||||
"userid": "zhangsan",
|
||||
"status": 0
|
||||
},
|
||||
{
|
||||
"userid": "lisi",
|
||||
"status": 1
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user