mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(work): 随官方标记通讯录同步相关接口或字段为废弃
This commit is contained in:
parent
141888e2c3
commit
1d15afd94e
@ -1,4 +1,6 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.change_contact 或 INFO.change_contact 事件的数据。</para>
|
||||
@ -125,6 +127,7 @@
|
||||
/// <summary>
|
||||
/// 获取或设置用户成员别名。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("Alias", IsNullable = true)]
|
||||
public string? UserAlias { get; set; }
|
||||
|
||||
@ -137,72 +140,84 @@
|
||||
/// <summary>
|
||||
/// 获取或设置用户的部门领导状态(以逗号分割)。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("IsLeaderInDept", IsNullable = true)]
|
||||
public string? UserDepartmentLeaderStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户的主部门 ID。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("MainDepartment", IsNullable = true)]
|
||||
public int? UserMainDepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户邮箱。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("Email", IsNullable = true)]
|
||||
public string? UserEmail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户企业邮箱。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("BizMail", IsNullable = true)]
|
||||
public string? UserBusinessEmail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户手机号码。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("Mobile", IsNullable = true)]
|
||||
public string? UserMobileNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户座机号码。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("Telephone", IsNullable = true)]
|
||||
public string? UserTeleNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户性别。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("Gender", IsNullable = true)]
|
||||
public int? UserGender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户地址。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("Address", IsNullable = true)]
|
||||
public string? UserAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户职务。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("Position", IsNullable = true)]
|
||||
public string? UserPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户头像 URL。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("Avatar", IsNullable = true)]
|
||||
public string? UserAvatarUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户激活状态。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("Status", IsNullable = true)]
|
||||
public int? UserStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户自定义字段信息。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("ExtAttr", IsNullable = true)]
|
||||
public Types.ExtendedAttribute? UserExtendedAttribute { get; set; }
|
||||
|
||||
@ -221,6 +236,7 @@
|
||||
/// <summary>
|
||||
/// 获取或设置部门次序值。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
|
||||
[System.Xml.Serialization.XmlElement("Order", IsNullable = true)]
|
||||
public long? DepartmentOrder { get; set; }
|
||||
|
||||
|
@ -374,5 +374,24 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinUserListSelectedTicketUserResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/user/list_id 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/40856 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserListIdResponse> ExecuteCgibinUserListIdAsync(this WechatWorkClient client, Models.CgibinUserListIdRequest 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", "user", "list_id")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinUserListIdResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/user/list_id 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinUserListIdRequest : WechatWorkRequest
|
||||
{
|
||||
/// <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,42 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/user/list_id 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinUserListIdResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class DepartmentUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department")]
|
||||
public long DepartmentId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员与部门关系列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("dept_user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("dept_user")]
|
||||
public Types.DepartmentUser[] DepartmentUser { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"cursor": "xxxxxxx",
|
||||
"limit": 10000
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"next_cursor": "aaaaaaaaa",
|
||||
"dept_user": [
|
||||
{
|
||||
"userid": "zhangsan",
|
||||
"department": 1
|
||||
},
|
||||
{
|
||||
"userid": "zhangsan",
|
||||
"department": 2
|
||||
},
|
||||
{
|
||||
"userid": "lisi",
|
||||
"department": 2
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user