mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 14:04:32 +08:00
feat(work): 新增客服升级服务配置相关接口
This commit is contained in:
parent
fe94e7d49e
commit
f0d19e79a0
@ -226,6 +226,71 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Customer
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [GET] /cgi-bin/kf/customer/get_upgrade_service_config 接口。</para>
|
||||||
|
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94674 </para>
|
||||||
|
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94702 </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinKfCustomerGetUpgradeServiceConfigResponse> ExecuteCgibinKfCustomerGetUpgradeServiceConfigAsync(this WechatWorkClient client, Models.CgibinKfCustomerGetUpgradeServiceConfigRequest 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", "customer", "get_upgrade_service_config")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.CgibinKfCustomerGetUpgradeServiceConfigResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /cgi-bin/kf/customer/upgrade_service 接口。</para>
|
||||||
|
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94674 </para>
|
||||||
|
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94702 </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinKfCustomerUpgradeServiceResponse> ExecuteCgibinKfCustomerUpgradeServiceAsync(this WechatWorkClient client, Models.CgibinKfCustomerUpgradeServiceRequest 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", "upgrade_service")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.CgibinKfCustomerUpgradeServiceResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /cgi-bin/kf/customer/cancel_upgrade_service 接口。</para>
|
||||||
|
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94674 </para>
|
||||||
|
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94702 </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinKfCustomerCancelUpgradeServiceResponse> ExecuteCgibinKfCustomerCancelUpgradeServiceAsync(this WechatWorkClient client, Models.CgibinKfCustomerCancelUpgradeServiceRequest 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", "cancel_upgrade_service")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.CgibinKfCustomerCancelUpgradeServiceResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>异步调用 [POST] /cgi-bin/kf/send_msg 接口。</para>
|
/// <para>异步调用 [POST] /cgi-bin/kf/send_msg 接口。</para>
|
||||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94677 </para>
|
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94677 </para>
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/kf/customer/cancel_upgrade_service 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinKfCustomerCancelUpgradeServiceRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置客服账号 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("open_kfid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("open_kfid")]
|
||||||
|
public string OpenKfId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置外部联系人账号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("external_userid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
|
||||||
|
public string ExternalUserId { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/kf/customer/cancel_upgrade_service 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinKfCustomerCancelUpgradeServiceResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [GET] /cgi-bin/kf/customer/get_upgrade_service_config 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinKfCustomerGetUpgradeServiceConfigRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [GET] /cgi-bin/kf/customer/get_upgrade_service_config 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinKfCustomerGetUpgradeServiceConfigResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class MemberRange
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置专员的 UserId 列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("userid_list")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("userid_list")]
|
||||||
|
public string[]? UserIdList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置专员的部门 ID 列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("department_id_list")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("department_id_list")]
|
||||||
|
public int[]? DepartmentIdList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GroupChatRange
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置客户群 ID 列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("chat_id_list")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("chat_id_list")]
|
||||||
|
public string[]? GroupChatIdList { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置专员服务配置范围信息。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("member_range")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("member_range")]
|
||||||
|
public Types.MemberRange? MemberRange { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置客户群配置范围信息。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("groupchat_range")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("groupchat_range")]
|
||||||
|
public Types.GroupChatRange? GroupChatRange { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/kf/customer/upgrade_service 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinKfCustomerUpgradeServiceRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class Member
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置服务专员的 UserId。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("userid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||||
|
public string UserId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置推荐语。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("wording")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("wording")]
|
||||||
|
public string? Wording { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GroupChat
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置客户群 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("chat_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("chat_id")]
|
||||||
|
public string GroupChatId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置推荐语。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("wording")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("wording")]
|
||||||
|
public string? Wording { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置客服账号 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("open_kfid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("open_kfid")]
|
||||||
|
public string OpenKfId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置外部联系人账号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("external_userid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
|
||||||
|
public string ExternalUserId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置升级服务类型。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("type")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||||
|
public int Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置专员信息。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("member")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("member")]
|
||||||
|
public Types.Member? Member { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置客户群信息。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("groupchat")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("groupchat")]
|
||||||
|
public Types.GroupChat? GroupChat { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/kf/customer/upgrade_service 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinKfCustomerUpgradeServiceResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"open_kfid": "kfxxxxxxxxxxxxxx",
|
||||||
|
"external_userid": "wmxxxxxxxxxxxxxxxxxx"
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok"
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
{}
|
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok",
|
||||||
|
"member_range": {
|
||||||
|
"userid_list": [
|
||||||
|
"zhangsan",
|
||||||
|
"lisi"
|
||||||
|
],
|
||||||
|
"department_id_list": [
|
||||||
|
2,
|
||||||
|
3
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"groupchat_range": {
|
||||||
|
"chat_id_list": [
|
||||||
|
"wraaaaaaaaaaaaaaaa",
|
||||||
|
"wrbbbbbbbbbbbbbbb"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"open_kfid": "kfxxxxxxxxxxxxxx",
|
||||||
|
"external_userid": "wmxxxxxxxxxxxxxxxxxx",
|
||||||
|
"type": 1,
|
||||||
|
"member": {
|
||||||
|
"userid": "zhangsan",
|
||||||
|
"wording": "你好,我是你的专属服务专员zhangsan"
|
||||||
|
},
|
||||||
|
"groupchat": {
|
||||||
|
"chat_id": "wraaaaaaaaaaaaaaaa",
|
||||||
|
"wording": "欢迎加入你的专属服务群"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user