mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-20 18:48:10 +08:00
feat(wxapi): 新增短剧媒资管理账号授权相关接口
This commit is contained in:
@@ -294,6 +294,100 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Vod
|
#region Vod
|
||||||
|
#region Vod/App
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /wxa/sec/vod/authorizeapp 接口。</para>
|
||||||
|
/// <para>
|
||||||
|
/// REF: <br/>
|
||||||
|
/// <![CDATA[ https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/mini-drama/mini_drama.html#_6-1-%E5%A2%9E%E5%8A%A0%E8%B4%A6%E5%8F%B7%E6%8E%88%E6%9D%83 ]]>
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.WxaSecVodAuthorizeAppResponse> ExecuteWxaSecVodAuthorizeAppAsync(this WechatApiClient client, Models.WxaSecVodAuthorizeAppRequest 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, "wxa", "sec", "vod", "authorizeapp")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendFlurlRequestAsJsonAsync<Models.WxaSecVodAuthorizeAppResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /wxa/sec/vod/deauthorizeapp 接口。</para>
|
||||||
|
/// <para>
|
||||||
|
/// REF: <br/>
|
||||||
|
/// <![CDATA[ https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/mini-drama/mini_drama.html#_6-2-%E8%A7%A3%E9%99%A4%E8%B4%A6%E5%8F%B7%E6%8E%88%E6%9D%83 ]]>
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.WxaSecVodDeauthorizeAppResponse> ExecuteWxaSecVodDeauthorizeAppAsync(this WechatApiClient client, Models.WxaSecVodDeauthorizeAppRequest 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, "wxa", "sec", "vod", "deauthorizeapp")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendFlurlRequestAsJsonAsync<Models.WxaSecVodDeauthorizeAppResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [GET] /wxa/sec/vod/getauthorizeapps 接口。</para>
|
||||||
|
/// <para>
|
||||||
|
/// REF: <br/>
|
||||||
|
/// <![CDATA[ https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/mini-drama/mini_drama.html#_6-2-%E8%A7%A3%E9%99%A4%E8%B4%A6%E5%8F%B7%E6%8E%88%E6%9D%83 ]]>
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.WxaSecVodGetAuthorizeAppsResponse> ExecuteWxaSecVodGetAuthorizeAppsAsync(this WechatApiClient client, Models.WxaSecVodGetAuthorizeAppsRequest 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.Get, "wxa", "sec", "vod", "getauthorizeapps")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendFlurlRequestAsJsonAsync<Models.WxaSecVodGetAuthorizeAppsResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [GET] /wxa/sec/vod/getauthorizedapps 接口。</para>
|
||||||
|
/// <para>
|
||||||
|
/// REF: <br/>
|
||||||
|
/// <![CDATA[ https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/mini-drama/mini_drama.html#_6-4-%E6%9F%A5%E8%AF%A2%E8%A2%AB%E8%B4%A6%E5%8F%B7%E6%8E%88%E6%9D%83%E4%BF%A1%E6%81%AF ]]>
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.WxaSecVodGetAuthorizedAppsResponse> ExecuteWxaSecVodGetAuthorizedAppsAsync(this WechatApiClient client, Models.WxaSecVodGetAuthorizedAppsRequest 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.Get, "wxa", "sec", "vod", "getauthorizedapps")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendFlurlRequestAsJsonAsync<Models.WxaSecVodGetAuthorizedAppsResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Vod/Upload
|
#region Vod/Upload
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>异步调用 [POST] /wxa/sec/vod/singlefileupload 接口。</para>
|
/// <para>异步调用 [POST] /wxa/sec/vod/singlefileupload 接口。</para>
|
||||||
@@ -442,7 +536,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region /Vod/Media
|
#region Vod/Media
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>异步调用 [POST] /wxa/sec/vod/listmedia 接口。</para>
|
/// <para>异步调用 [POST] /wxa/sec/vod/listmedia 接口。</para>
|
||||||
/// <para>
|
/// <para>
|
||||||
@@ -536,7 +630,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region /Vod/Drama
|
#region Vod/Drama
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>异步调用 [POST] /wxa/sec/vod/auditdrama 接口。</para>
|
/// <para>异步调用 [POST] /wxa/sec/vod/auditdrama 接口。</para>
|
||||||
/// <para>
|
/// <para>
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /wxa/sec/vod/authorizeapp 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class WxaSecVodAuthorizeAppRequest : WechatApiRequest, IInferable<WxaSecVodAuthorizeAppRequest, WxaSecVodAuthorizeAppResponse>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置被授权方小程序 AppId。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("authorized_appid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("authorized_appid")]
|
||||||
|
public string AuthorizedAppId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置授权到期时间戳。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("authz_expire_time")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("authz_expire_time")]
|
||||||
|
public long? ExpireTimestamp { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /wxa/sec/vod/authorizeapp 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class WxaSecVodAuthorizeAppResponse : WechatApiResponse
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,15 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /wxa/sec/vod/deauthorizeapp 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class WxaSecVodDeauthorizeAppRequest : WechatApiRequest, IInferable<WxaSecVodDeauthorizeAppRequest, WxaSecVodDeauthorizeAppResponse>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置被授权方小程序 AppId。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("authorized_appid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("authorized_appid")]
|
||||||
|
public string AuthorizedAppId { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /wxa/sec/vod/deauthorizeapp 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class WxaSecVodDeauthorizeAppResponse : WechatApiResponse
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [GET] /wxa/sec/vod/getauthorizeapps 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class WxaSecVodGetAuthorizeAppsRequest : WechatApiRequest, IInferable<WxaSecVodGetAuthorizeAppsRequest, WxaSecVodGetAuthorizeAppsResponse>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,41 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [GET] /wxa/sec/vod/getauthorizeapps 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class WxaSecVodGetAuthorizeAppsResponse : WechatApiResponse
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class Object
|
||||||
|
{
|
||||||
|
/// 获取或设置被授权方小程序 AppId。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("authorized_appid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("authorized_appid")]
|
||||||
|
public string AuthorizedAppId { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置授权时间戳。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("authorized_time")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("authorized_time")]
|
||||||
|
public long AuthorizeTimestamp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置授权到期时间戳。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("authz_expire_time")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("authz_expire_time")]
|
||||||
|
public long? ExpireTimestamp { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置授权列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("objects")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("objects")]
|
||||||
|
public Types.Object[] ObjectList { get; set; } = default!;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [GET] /wxa/sec/vod/getauthorizedapps 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class WxaSecVodGetAuthorizedAppsRequest : WechatApiRequest, IInferable<WxaSecVodGetAuthorizedAppsRequest, WxaSecVodGetAuthorizedAppsResponse>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,41 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [GET] /wxa/sec/vod/getauthorizedapps 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class WxaSecVodGetAuthorizedAppsResponse : WechatApiResponse
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class Object
|
||||||
|
{
|
||||||
|
/// 获取或设置授权方小程序 AppId。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("authorizer_appid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("authorizer_appid")]
|
||||||
|
public string AuthorizerAppId { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置授权时间戳。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("authorized_time")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("authorized_time")]
|
||||||
|
public long AuthorizeTimestamp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置授权到期时间戳。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("authz_expire_time")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("authz_expire_time")]
|
||||||
|
public long? ExpireTimestamp { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置授权列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("objects")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("objects")]
|
||||||
|
public Types.Object[] ObjectList { get; set; } = default!;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"authorized_appid": "wx*************",
|
||||||
|
"authz_expire_time": 0
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"authorized_appid": "wx*************"
|
||||||
|
}
|
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok",
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"authorized_appid": "wx**********",
|
||||||
|
"authorized_time": 1702020510,
|
||||||
|
"authz_expire_time": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"authorized_appid": "wx**********",
|
||||||
|
"authorized_time": 1702020549,
|
||||||
|
"authz_expire_time": 1703120549
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok",
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"authorizer_appid": "wx**********",
|
||||||
|
"authorized_time": 1702020510,
|
||||||
|
"authz_expire_time": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Reference in New Issue
Block a user