mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-21 02:58:06 +08:00
feat(work): 新增获取企业上下游通讯录下的企业信息接口
This commit is contained in:
@@ -175,6 +175,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
|||||||
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCorpGetChainCorpInfoListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCorpGetChainCorpInfoListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/get_chain_corpinfo 接口。</para>
|
||||||
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95820 </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinCorpGroupCorpGetChainCorpInfoResponse> ExecuteCgibinCorpGroupCorpGetChainCorpInfoAsync(this WechatWorkClient client, Models.CgibinCorpGroupCorpGetChainCorpInfoRequest 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", "corpgroup", "corp", "get_chain_corpinfo")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCorpGetChainCorpInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/remove_corp 接口。</para>
|
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/remove_corp 接口。</para>
|
||||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95822 </para>
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95822 </para>
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/corpgroup/corp/get_chain_corpinfo 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinCorpGroupCorpGetChainCorpInfoRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置上下游 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("chain_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("chain_id")]
|
||||||
|
public string ChainId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置下级企业 CorpId。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||||
|
public string CorpId { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,22 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/corpgroup/corp/get_chain_corpinfo 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinCorpGroupCorpGetChainCorpInfoResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置分组 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("groupid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("groupid")]
|
||||||
|
public int GroupId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置自定义 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("custom_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("custom_id")]
|
||||||
|
public string? CustomId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"chain_id": "Chxxxxxx",
|
||||||
|
"corpid": "xxxxx"
|
||||||
|
}
|
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok",
|
||||||
|
"custom_id": "xxxxx",
|
||||||
|
"groupid": 1
|
||||||
|
}
|
Reference in New Issue
Block a user