mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
新增会议 MRA 管理相关接口
This commit is contained in:
parent
b4b4f0fe6c
commit
f8f428da68
@ -496,6 +496,88 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region MRA
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/meeting/mra/query_status 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98786 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMeetingMRAQueryStatusResponse> ExecuteCgibinMeetingMRAQueryStatusAsync(this WechatWorkClient client, Models.CgibinMeetingMRAQueryStatusRequest 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", "meeting", "mra", "query_status")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMeetingMRAQueryStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/meeting/mra/set_default_layout 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98787 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMeetingMRASetDefaultLayoutResponse> ExecuteCgibinMeetingMRASetDefaultLayoutAsync(this WechatWorkClient client, Models.CgibinMeetingMRASetDefaultLayoutRequest 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", "meeting", "mra", "set_default_layout")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMeetingMRASetDefaultLayoutResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/meeting/mra/set_raise_hand 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98788 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMeetingMRASetRaiseHandResponse> ExecuteCgibinMeetingMRASetRaiseHandAsync(this WechatWorkClient client, Models.CgibinMeetingMRASetRaiseHandRequest 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", "meeting", "mra", "set_raise_hand")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMeetingMRASetRaiseHandResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/meeting/mra/hangup 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98789 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMeetingMRAHangupResponse> ExecuteCgibinMeetingMRAHangupAsync(this WechatWorkClient client, Models.CgibinMeetingMRAHangupRequest 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", "meeting", "mra", "hangup")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMeetingMRAHangupResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Phone
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/meeting/phone/callout 接口。</para>
|
||||
|
@ -0,0 +1,35 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/mra/hangup 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingMRAHangupRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class MRA
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会议的成员临时 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tmp_openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tmp_openid")]
|
||||
public string TempOpenId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会议 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("meetingid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("meetingid")]
|
||||
public string MeetingId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会议连接器信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mra")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mra")]
|
||||
public Types.MRA MRA { get; set; } = new Types.MRA();
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/mra/hangup 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingMRAHangupResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/mra/query_status 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingMRAQueryStatusRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会议 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("meetingid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("meetingid")]
|
||||
public string MeetingId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会议的成员临时 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tmp_openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tmp_openid")]
|
||||
public string TempOpenId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/mra/query_status 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingMRAQueryStatusResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会议的成员临时 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tmp_openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tmp_openid")]
|
||||
public string TempOpenId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置终端设备类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("instance_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("instance_id")]
|
||||
public int InstanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员角色。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user_role")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_role")]
|
||||
public int UserRole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置网络研讨会成员角色。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("webinar_member_role")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("webinar_member_role")]
|
||||
public int? WebinarMemberRole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 IP 地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ip")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ip")]
|
||||
public string? IpAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置显示名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? DisplayName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否开启麦克风。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("audio_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("audio_state")]
|
||||
public bool IsAudioOpen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否开启摄像头。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("video_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("video_state")]
|
||||
public bool IsVideoOpen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否屏幕共享。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("screen_shared_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("screen_shared_state")]
|
||||
public bool IsScreenShared { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置默认分屏设置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("default_layout")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("default_layout")]
|
||||
public int DefaultLayout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否举手。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("raise_hands_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("raise_hands_state")]
|
||||
public bool IsRaiseHand { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/mra/set_default_layout 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingMRASetDefaultLayoutRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class MRA
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会议的成员临时 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tmp_openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tmp_openid")]
|
||||
public string TempOpenId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会议 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("meetingid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("meetingid")]
|
||||
public string MeetingId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置默认分屏设置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("default_layout")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("default_layout")]
|
||||
public int DefaultLayout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置默认非视频与会者在分屏中显示方式。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("default_novideo_user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("default_novideo_user")]
|
||||
public int DefaultNoVideoUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会议连接器信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mra")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mra")]
|
||||
public Types.MRA MRA { get; set; } = new Types.MRA();
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/mra/set_default_layout 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingMRASetDefaultLayoutResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/mra/set_raise_hand 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingMRASetRaiseHandRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class MRA
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会议的成员临时 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tmp_openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tmp_openid")]
|
||||
public string TempOpenId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会议 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("meetingid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("meetingid")]
|
||||
public string MeetingId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否举手。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("raise_hand")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("raise_hand")]
|
||||
public bool IsRaiseHand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会议连接器信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mra")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mra")]
|
||||
public Types.MRA MRA { get; set; } = new Types.MRA();
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/mra/set_raise_hand 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingMRASetRaiseHandResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"meetingid": "MEETINGID",
|
||||
"mra": {
|
||||
"tmp_openid": "TMP_OPENID"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"meetingid": "MEETINGID",
|
||||
"tmp_openid": "TMP_OPENID"
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"tmp_openid": "TMP_OPENID",
|
||||
"instance_id": 9,
|
||||
"user_role": 0,
|
||||
"webinar_member_role": 0,
|
||||
"ip": "192.168.2.2",
|
||||
"name": "user2",
|
||||
"audio_state": true,
|
||||
"video_state": false,
|
||||
"screen_shared_state": false,
|
||||
"default_layout": 1,
|
||||
"raise_hands_state": false
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"meetingid": "MEETINGID",
|
||||
"default_layout": 2,
|
||||
"default_novideo_user": 1,
|
||||
"mra": {
|
||||
"tmp_openid": "TMP_OPENID"
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"meetingid": "MEETINGID",
|
||||
"raise_hand": true,
|
||||
"mra": {
|
||||
"tmp_openid": "TMP_OPENID"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user