mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-18 04:33:16 +08:00
feat(work): 新增日程参与者相关接口
This commit is contained in:
parent
abd7265a47
commit
543a4cf662
@ -597,6 +597,50 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
|||||||
|
|
||||||
return await client.SendRequestWithJsonAsync<Models.CgibinOAScheduleDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
return await client.SendRequestWithJsonAsync<Models.CgibinOAScheduleDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region ScheduleAttendees
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /cgi-bin/oa/schedule/add_attendees 接口。</para>
|
||||||
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93648 </para>
|
||||||
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93703 </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinOAScheduleAddAttendeesResponse> ExecuteCgibinOAScheduleAddAttendeesAsync(this WechatWorkClient client, Models.CgibinOAScheduleAddAttendeesRequest 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", "oa", "schedule", "add_attendees")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.CgibinOAScheduleAddAttendeesResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /cgi-bin/oa/schedule/del_attendees 接口。</para>
|
||||||
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93648 </para>
|
||||||
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93703 </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinOAScheduleDeleteAttendeesResponse> ExecuteCgibinOAScheduleDeleteAttendeesAsync(this WechatWorkClient client, Models.CgibinOAScheduleDeleteAttendeesRequest 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", "oa", "schedule", "del_attendees")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.CgibinOAScheduleDeleteAttendeesResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/oa/schedule/add_attendees 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinOAScheduleAddAttendeesRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class Attendee : CgibinOAScheduleAddRequest.Types.Schedule.Types.Attendee
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置日程 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("schedule_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("schedule_id")]
|
||||||
|
public string ScheduleId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置要添加的日程参与者列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("attendees")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("attendees")]
|
||||||
|
public IList<Types.Attendee> AttendeeList { get; set; } = new List<Types.Attendee>();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/oa/schedule/add_attendees 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinOAScheduleAddAttendeesResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/oa/schedule/del_attendees 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinOAScheduleDeleteAttendeesRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class Attendee : CgibinOAScheduleAddAttendeesRequest.Types.Attendee
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置日程 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("schedule_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("schedule_id")]
|
||||||
|
public string ScheduleId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置要删除的日程参与者列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("attendees")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("attendees")]
|
||||||
|
public IList<Types.Attendee> AttendeeList { get; set; } = new List<Types.Attendee>();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/oa/schedule/del_attendees 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinOAScheduleDeleteAttendeesResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("appid")]
|
[Newtonsoft.Json.JsonProperty("appid")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||||
public string? AppId { get; set; }
|
public int? AppId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置安装渠道。
|
/// 获取或设置安装渠道。
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"schedule_id": "17c7d2bd9f20d652840f72f59e796AAA",
|
||||||
|
"attendees": [
|
||||||
|
{
|
||||||
|
"userid": "userid2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok"
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"schedule_id": "17c7d2bd9f20d652840f72f59e796AAA",
|
||||||
|
"attendees": [
|
||||||
|
{
|
||||||
|
"userid": "userid2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user