mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-18 17:48:12 +08:00
feat(work): 新增文档高级功能账号相关接口
This commit is contained in:
@@ -374,5 +374,67 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
|||||||
return await client.SendRequestWithJsonAsync<Models.CgibinWedocSpreadSheetGetSheetRangeDataResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
return await client.SendRequestWithJsonAsync<Models.CgibinWedocSpreadSheetGetSheetRangeDataResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Vip
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /cgi-bin/wedoc/vip/batch_add 接口。</para>
|
||||||
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/99516 </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinWedocVipBatchAddResponse> ExecuteCgibinWedocVipBatchAddAsync(this WechatWorkClient client, Models.CgibinWedocVipBatchAddRequest 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", "wedoc", "vip", "batch_add")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.CgibinWedocVipBatchAddResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /cgi-bin/wedoc/vip/batch_del 接口。</para>
|
||||||
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/99517 </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinWedocVipBatchDeleteResponse> ExecuteCgibinWedocVipBatchDeleteAsync(this WechatWorkClient client, Models.CgibinWedocVipBatchDeleteRequest 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", "wedoc", "vip", "batch_del")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.CgibinWedocVipBatchDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /cgi-bin/wedoc/vip/list 接口。</para>
|
||||||
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/99518 </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinWedocVipListResponse> ExecuteCgibinWedocVipListAsync(this WechatWorkClient client, Models.CgibinWedocVipListRequest 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", "wedoc", "vip", "list")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.CgibinWedocVipListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -92,7 +92,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("customer_list")]
|
[Newtonsoft.Json.JsonProperty("customer_list")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("customer_list")]
|
[System.Text.Json.Serialization.JsonPropertyName("customer_list")]
|
||||||
public Types.Customer[] CustomerLsit { get; set; } = default!;
|
public Types.Customer[] CustomerList { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置无效的外部联系人账号列表。
|
/// 获取或设置无效的外部联系人账号列表。
|
||||||
|
@@ -0,0 +1,17 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/wedoc/vip/batch_add 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinWedocVipBatchAddRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置成员账号列表。
|
||||||
|
/// </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/wedoc/vip/batch_add 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinWedocVipBatchAddResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置分配成功的成员账号列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("succ_userid_list")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("succ_userid_list")]
|
||||||
|
public string[]? SuccessfulUserIdList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置分配失败的成员账号列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("fail_userid_list")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("fail_userid_list")]
|
||||||
|
public string[]? FailedUserIdList { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,17 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/wedoc/vip/batch_del 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinWedocVipBatchDeleteRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置成员账号列表。
|
||||||
|
/// </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/wedoc/vip/batch_del 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinWedocVipBatchDeleteResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置撤销分配成功的成员账号列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("succ_userid_list")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("succ_userid_list")]
|
||||||
|
public string[]? SuccessfulUserIdList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置撤销分配失败的成员账号列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("fail_userid_list")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("fail_userid_list")]
|
||||||
|
public string[]? FailedUserIdList { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,22 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/wedoc/vip/list 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinWedocVipListRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置分页每页数量。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("limit")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||||
|
public int? Limit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置翻页标记。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||||
|
public string? Cursor { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,29 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/wedoc/vip/list 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinWedocVipListResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置成员账号列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("userid_list")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("userid_list")]
|
||||||
|
public string[] UserIdList { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置是否还有更多数据。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||||
|
public bool HasMore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置翻页标记。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||||
|
public string? NextCursor { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"userid_list": [ "zhangsan", "lisi", "wangwu" ]
|
||||||
|
}
|
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok",
|
||||||
|
"succ_userid_list": [ "zhangsan", "lisi" ],
|
||||||
|
"fail_userid_list": [ "wangwu" ]
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"userid_list": [ "zhangsan", "lisi", "wangwu" ]
|
||||||
|
}
|
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok",
|
||||||
|
"succ_userid_list": [ "zhangsan", "lisi" ],
|
||||||
|
"fail_userid_list": [ "wangwu" ]
|
||||||
|
}
|
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"cursor": "CURSOR",
|
||||||
|
"limit": 2
|
||||||
|
}
|
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok",
|
||||||
|
"has_more": true,
|
||||||
|
"next_cursor": "GNIJIGEO",
|
||||||
|
"userid_list": [ "zhangsan", "lisi" ]
|
||||||
|
}
|
Reference in New Issue
Block a user