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
0ca361f14b
commit
0521c968d8
@ -104,6 +104,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinAgentSetScopeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/migrate_to_customized_app 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96072 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinAgentMigrateToCustomizedAppResponse> ExecuteCgibinAgentMigrateToCustomizedAppAsync(this WechatWorkClient client, Models.CgibinAgentMigrateToCustomizedAppRequest 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", "agent", "migrate_to_customized_app")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinAgentMigrateToCustomizedAppResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
#region Workbench
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/set_workbench_template 接口。</para>
|
||||
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/migrate_to_customized_app 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentMigrateToCustomizedAppRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置代开发应用模版接口调用凭证。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("suite_access_token")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("suite_access_token")]
|
||||
public string SuiteAccessToken { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/migrate_to_customized_app 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentMigrateToCustomizedAppResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"suite_access_token": "SUITE_ACCESS_TOKEN"
|
||||
}
|
Loading…
Reference in New Issue
Block a user