mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-11 02:07:49 +08:00
feat(work): 新增第三方应用获取应用管理员列表接口
This commit is contained in:
@@ -162,6 +162,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
|||||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentGetPermissionsResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentGetPermissionsResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /cgi-bin/agent/get_admin_list 接口。</para>
|
||||||
|
/// <para>
|
||||||
|
/// REF: <br/>
|
||||||
|
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/100073 ]]>
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinAgentGetAdminListResponse> ExecuteCgibinAgentGetAdminListAsync(this WechatWorkClient client, Models.CgibinAgentGetAdminListRequest 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
|
||||||
|
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "agent", "get_admin_list")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentGetAdminListResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
#region Workbench
|
#region Workbench
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>异步调用 [POST] /cgi-bin/agent/set_workbench_template 接口。</para>
|
/// <para>异步调用 [POST] /cgi-bin/agent/set_workbench_template 接口。</para>
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/agent/get_admin_list 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinAgentGetAdminListRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/agent/get_admin_list 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinAgentGetAdminListResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class Administrator
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置成员账号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("userid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||||
|
public string UserId { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置管理权限。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("auth_type")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("auth_type")]
|
||||||
|
public int AuthType { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置管理员列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("admin")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("admin")]
|
||||||
|
public Types.Administrator[]? AdministratorList { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok",
|
||||||
|
"admin": [
|
||||||
|
{
|
||||||
|
"userid": "woxxxx",
|
||||||
|
"auth_type": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"userid": "woxxxx",
|
||||||
|
"auth_type": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user