mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-19 07:44:46 +08:00
feat(wxapi): 新增第三方平台申请开通直播相关接口
This commit is contained in:
parent
39dbcb4434
commit
06015f2151
@ -160,6 +160,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
#endregion
|
||||
|
||||
#region LiveBroadcast
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/applyliveinfo 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Business/live_player/applyliveinfo.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaBusinessApplyLiveInfoResponse> ExecuteWxaBusinessApplyLiveInfoAsync(this WechatApiClient client, Models.WxaBusinessApplyLiveInfoRequest 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, "wxa", "business", "applyliveinfo")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaBusinessApplyLiveInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/business/getliveinfo 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/framework/liveplayer/studio-api.html#2 </para>
|
||||
|
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/applyliveinfo 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessApplyLiveInfoRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置执行动作。
|
||||
/// <para>默认值:</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("action")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("action")]
|
||||
public string Action { get; set; } = "apply";
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/business/applyliveinfo 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class WxaBusinessApplyLiveInfoResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置执行动作。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("action")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("action")]
|
||||
public string Action { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"action": "apply"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"action": "apply"
|
||||
}
|
Loading…
Reference in New Issue
Block a user