mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 23:13:32 +08:00
feat(work): 新增会议 PSTN 管理相关接口
This commit is contained in:
parent
8eafc34ab9
commit
b4b4f0fe6c
@ -495,5 +495,67 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMeetingEnrollDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Phone
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/meeting/phone/callout 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98823 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMeetingPhoneCalloutResponse> ExecuteCgibinMeetingPhoneCalloutAsync(this WechatWorkClient client, Models.CgibinMeetingPhoneCalloutRequest 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", "phone", "callout")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMeetingPhoneCalloutResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/meeting/phone/get_callout_status 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98824 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMeetingPhoneGetCalloutStatusResponse> ExecuteCgibinMeetingPhoneGetCalloutStatusAsync(this WechatWorkClient client, Models.CgibinMeetingPhoneGetCalloutStatusRequest 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", "phone", "get_callout_status")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMeetingPhoneGetCalloutStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/meeting/phone/get_tmp_openid 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98825 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMeetingPhoneGetTempOpenIdResponse> ExecuteCgibinMeetingPhoneGetTempOpenIdAsync(this WechatWorkClient client, Models.CgibinMeetingPhoneGetTempOpenIdRequest 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", "phone", "get_tmp_openid")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMeetingPhoneGetTempOpenIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
public string AreaCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码。
|
||||
/// 获取或设置电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone_number")]
|
||||
|
@ -151,7 +151,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
public string AreaCode { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码。
|
||||
/// 获取或设置电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone_number")]
|
||||
|
@ -26,7 +26,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
public string? AreaCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码。
|
||||
/// 获取或设置电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone_number")]
|
||||
|
@ -31,7 +31,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
public string? AreaCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码。
|
||||
/// 获取或设置电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone_number")]
|
||||
|
@ -0,0 +1,53 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/phone/callout 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingPhoneCalloutRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Callout
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置国家地区代码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("area")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalStringConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("area")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringConverter))]
|
||||
public string AreaCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone")]
|
||||
public string PhoneNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分机号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("extension_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("extension_number")]
|
||||
public string? ExtensionNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <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("phone_numbers")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone_numbers")]
|
||||
public IList<Types.Callout> Calloutist { get; set; } = new List<Types.Callout>();
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/phone/callout 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingPhoneCalloutResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Callout
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置国家地区代码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("area")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("area")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))]
|
||||
public string AreaCode { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone")]
|
||||
public string PhoneNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分机号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("extension_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("extension_number")]
|
||||
public string? ExtensionNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置外呼状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public string? Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成功的外呼列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone_numbers")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone_numbers")]
|
||||
public Types.Callout[] SuccessfulCalloutList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置不合法的外呼列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("invalid_phone_numbers")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("invalid_phone_numbers")]
|
||||
public Types.Callout[] InvalidCalloutList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/phone/get_callout_status 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingPhoneGetCalloutStatusRequest : WechatWorkRequest
|
||||
{
|
||||
/// <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("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,71 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/phone/get_callout_status 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingPhoneGetCalloutStatusResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Callout
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置国家地区代码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("area")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("area")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))]
|
||||
public string AreaCode { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone")]
|
||||
public string PhoneNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分机号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("extension_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("extension_number")]
|
||||
public string? ExtensionNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置外呼状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public string Status { get; set; } = default!;
|
||||
|
||||
/// <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("phone_numbers")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone_numbers")]
|
||||
public Types.Callout[] CalloutList { 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,31 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/phone/get_tmp_openid 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingPhoneGetTempOpenIdRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Callout : CgibinMeetingPhoneCalloutRequest.Types.Callout
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <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("phone_numbers")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone_numbers")]
|
||||
public IList<Types.Callout> Calloutist { get; set; } = new List<Types.Callout>();
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/meeting/phone/get_tmp_openid 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMeetingPhoneGetTempOpenIdResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Callout
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置国家地区代码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("area")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("area")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))]
|
||||
public string AreaCode { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone")]
|
||||
public string PhoneNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分机号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("extension_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("extension_number")]
|
||||
public string? ExtensionNumber { get; set; }
|
||||
|
||||
/// <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("tmp_openid_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tmp_openid_list")]
|
||||
public Types.Callout[] CalloutList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"meetingid": "MEETINGID",
|
||||
"phone_numbers": [
|
||||
{
|
||||
"area": 86,
|
||||
"phone": "13333333333",
|
||||
"extension_number": "12345678"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"phone_numbers": [
|
||||
{
|
||||
"area": 86,
|
||||
"phone": "13333333333",
|
||||
"extension_number": "12345678",
|
||||
"status": "STATUS"
|
||||
}
|
||||
],
|
||||
"invalid_phone_numbers": [
|
||||
{
|
||||
"area": 86,
|
||||
"phone": "13333333333",
|
||||
"extension_number": "12345678"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"meetingid": "MEETINGID",
|
||||
"cursor": "CURSOR",
|
||||
"limit": 10
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"phone_numbers": [
|
||||
{
|
||||
"area": 86,
|
||||
"phone": "13333333333",
|
||||
"extension_number": "12345678",
|
||||
"status": "STATUS",
|
||||
"tmp_openid": "TMP_OPENID"
|
||||
}
|
||||
],
|
||||
"next_cursor": "NEXT_CURSOR",
|
||||
"has_more": false
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"meetingid": "MEETINGID",
|
||||
"phone_numbers": [
|
||||
{
|
||||
"area": 86,
|
||||
"phone": "13333333333",
|
||||
"extension_number": "12345678"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"tmp_openid_list": [
|
||||
{
|
||||
"area": 86,
|
||||
"phone": "13333333333",
|
||||
"extension_number": "12345678",
|
||||
"tmp_openid": "TMP_OPENID"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user