mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-11 10:16:20 +08:00
feat(work): 新增获取企业已配置的联系我列表接口
This commit is contained in:
@@ -306,8 +306,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
#region ContactWay
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/add_contact_way 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92572 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92577 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92228 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96348 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -327,8 +327,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/get_contact_way 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92572 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92577 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92228 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96348 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -346,10 +346,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactGetContactWayResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/list_contact_way 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92228 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96348 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExternalContactListContactWayResponse> ExecuteCgibinExternalContactListContactWayAsync(this WechatWorkClient client, Models.CgibinExternalContactListContactWayRequest 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", "externalcontact", "list_contact_way")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactListContactWayResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/update_contact_way 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92572 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92577 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92228 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96348 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -369,8 +390,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/del_contact_way 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92572 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92577 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92228 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96348 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/list_contact_way 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactListContactWayRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置起始时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("start_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
|
||||
public long? StartTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结束时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("end_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
|
||||
public long? EndTimestamp { get; set; }
|
||||
|
||||
/// <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,35 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/list_contact_way 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactListContactWayResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ContactWay
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置配置 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config_id")]
|
||||
public string ConfigId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系方式列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_way")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_way")]
|
||||
public Types.ContactWay[] ContactWayList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user