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:
@@ -726,6 +726,77 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinWedocSmartSheetDeleteRecordsResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
#region SmartSheet/GroupChat
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/wedoc/smartsheet/groupchat/list 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/100989 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinWedocSmartSheetGroupChatListResponse> ExecuteCgibinWedocSmartSheetGroupChatListAsync(this WechatWorkClient client, Models.CgibinWedocSmartSheetGroupChatListRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "wedoc", "smartsheet", "groupchat", "list")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinWedocSmartSheetGroupChatListResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/wedoc/smartsheet/groupchat/get 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/101028 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinWedocSmartSheetGroupChatGetResponse> ExecuteCgibinWedocSmartSheetGroupChatGetAsync(this WechatWorkClient client, Models.CgibinWedocSmartSheetGroupChatGetRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "wedoc", "smartsheet", "groupchat", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinWedocSmartSheetGroupChatGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/wedoc/smartsheet/groupchat/update 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/101029 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinWedocSmartSheetGroupChatUpdateResponse> ExecuteCgibinWedocSmartSheetGroupChatUpdateAsync(this WechatWorkClient client, Models.CgibinWedocSmartSheetGroupChatUpdateRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "wedoc", "smartsheet", "groupchat", "update")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinWedocSmartSheetGroupChatUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region SpreadSheet
|
||||
|
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/wedoc/smartsheet/groupchat/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinWedocSmartSheetGroupChatGetRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文档 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("docid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("docid")]
|
||||
public string DocumentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置群聊 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_id")]
|
||||
public string GroupChatId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/wedoc/smartsheet/groupchat/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinWedocSmartSheetGroupChatGetResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置群聊名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置群主成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("owner")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("owner")]
|
||||
public string OwnerUserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置群成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_list")]
|
||||
public string[] UserIdList { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/wedoc/smartsheet/groupchat/list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinWedocSmartSheetGroupChatListRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文档 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("docid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("docid")]
|
||||
public string DocumentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/wedoc/smartsheet/groupchat/list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinWedocSmartSheetGroupChatListResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置群聊 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_id_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_id_list")]
|
||||
public string[] GroupChatIdList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
public bool HasMore { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/wedoc/smartsheet/groupchat/update 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinWedocSmartSheetGroupChatUpdateRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文档 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("docid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("docid")]
|
||||
public string DocumentId { get; set; } = string.Empty;
|
||||
|
||||
/// <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("owner")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("owner")]
|
||||
public string? OwnerUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置添加的群成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("add_user_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("add_user_list")]
|
||||
public IList<string>? AddedUserIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置移除的群成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("del_user_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("del_user_list")]
|
||||
public IList<string>? DeletedUserIdList { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/wedoc/smartsheet/groupchat/update 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinWedocSmartSheetGroupChatUpdateResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/wedrive/file_list 接口的请求。</para>
|
||||
@@ -27,11 +27,11 @@
|
||||
public int SortType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页起始位置。
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("start")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("start")]
|
||||
public int Offset { get; set; }
|
||||
public int Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
|
@@ -1,4 +1,4 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/wedrive/file_list 接口的响应。</para>
|
||||
@@ -120,10 +120,10 @@
|
||||
public bool HasMore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_start")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_start")]
|
||||
public int? NextStart { get; set; }
|
||||
public int? NextCursor { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"docid": "DOCID",
|
||||
"chat_id": "CHATID"
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"name": "NAME",
|
||||
"owner": "userid2",
|
||||
"user_list": [ "userid1", "userid2", "userid3" ]
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"docid": "DOCID",
|
||||
"cursor": "CURSOR",
|
||||
"limit": 2
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"has_more": true,
|
||||
"next_cursor": "GNIJIGEO",
|
||||
"chat_id_list": [ "chatid1", "chatid2" ]
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"docid": "DOCID",
|
||||
"chat_id": "CHATID",
|
||||
"owner": "userid",
|
||||
"add_user_list": [ "userid1", "userid2", "userid3" ],
|
||||
"del_user_list": [ "userid3", "userid4" ]
|
||||
}
|
Reference in New Issue
Block a user