mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-16 16:50:43 +08:00
feat(wxapi): 新增小程序短剧播放器推荐位控制接口
This commit is contained in:
parent
bf4153e0c9
commit
d64443d5fd
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
{
|
||||
public static class WechatApiClientExecuteWxaDramaExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxadrama/setplayerdramarecmdswitch 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/videoplayer.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaDramaSetPlayerDramaRecommendSwitchResponse> ExecuteWxaDramaSetPlayerDramaRecommendSwitchAsync(this WechatApiClient client, Models.WxaDramaSetPlayerDramaRecommendSwitchRequest 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, "wxadrama", "setplayerdramarecmdswitch")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaDramaSetPlayerDramaRecommendSwitchResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxadrama/setplayerdramarecmdswitch 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class WxaDramaSetPlayerDramaRecommendSwitchRequest : WechatApiRequest, IInferable<WxaDramaSetPlayerDramaRecommendSwitchRequest, WxaDramaSetPlayerDramaRecommendSwitchResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置推荐位类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("entry_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("entry_type")]
|
||||
public int EntryType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否打开。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("switch_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("switch_status")]
|
||||
public bool IsOpen { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxadrama/setplayerdramarecmdswitch 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class WxaDramaSetPlayerDramaRecommendSwitchResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"entry_type": 1,
|
||||
"switch_status": true
|
||||
}
|
Loading…
Reference in New Issue
Block a user