mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-12-21 19:09:58 +08:00
feat(wxapi): 移除部分已标记为废弃的接口及模型
This commit is contained in:
@@ -10,30 +10,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
{
|
||||
public static class WechatApiClientExecuteCgibinMaterialExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/material/add_news 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/Adding_Permanent_Assets.html#%E6%96%B0%E5%A2%9E%E6%B0%B8%E4%B9%85%E5%9B%BE%E6%96%87%E7%B4%A0%E6%9D%90 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("相关接口或字段于 2022-02-25 下线。")]
|
||||
public static async Task<Models.CgibinMaterialAddNewsResponse> ExecuteCgibinMaterialAddNewsAsync(this WechatApiClient client, Models.CgibinMaterialAddNewsRequest 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, "cgi-bin", "material", "add_news")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinMaterialAddNewsResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/material/add_material 接口。</para>
|
||||
/// <para>
|
||||
@@ -118,30 +94,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinMaterialGetMaterialResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/material/get_material 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/Getting_Permanent_Assets.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("相关接口或字段于 2022-02-25 下线。")]
|
||||
public static async Task<Models.CgibinMaterialGetMaterialAsNewsResponse> ExecuteCgibinMaterialGetMaterialAsNewsAsync(this WechatApiClient client, Models.CgibinMaterialGetMaterialAsNewsRequest 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, "cgi-bin", "material", "get_material")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinMaterialGetMaterialAsNewsResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/material/get_material 接口。</para>
|
||||
/// <para>
|
||||
@@ -188,30 +140,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinMaterialDeleteMaterialResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/material/update_news 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/Editing_Permanent_Rich_Media_Assets.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("相关接口或字段于 2022-02-25 下线。")]
|
||||
public static async Task<Models.CgibinMaterialUpdateNewsResponse> ExecuteCgibinMaterialUpdateNewsAsync(this WechatApiClient client, Models.CgibinMaterialUpdateNewsRequest 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, "cgi-bin", "material", "update_news")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinMaterialUpdateNewsResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/material/get_materialcount 接口。</para>
|
||||
/// <para>
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/material/add_news 接口的请求。</para>
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-02-25 下线。")]
|
||||
public class CgibinMaterialAddNewsRequest : WechatApiRequest, IInferable<CgibinMaterialAddNewsRequest, CgibinMaterialAddNewsResponse>
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Article : CgibinMediaUploadNewsRequest.Types.Article
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("articles")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("articles")]
|
||||
public IList<Types.Article> ArticleList { get; set; } = new List<Types.Article>();
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/material/add_news 接口的响应。</para>
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-02-25 下线。")]
|
||||
public class CgibinMaterialAddNewsResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置媒体文件标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/material/get_material 接口的请求。</para>
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-02-25 下线。")]
|
||||
public class CgibinMaterialGetMaterialAsNewsRequest : CgibinMaterialGetMaterialRequest, IInferable<CgibinMaterialGetMaterialAsNewsRequest, CgibinMaterialGetMaterialAsNewsResponse>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/material/get_material 接口的响应。</para>
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-02-25 下线。")]
|
||||
public class CgibinMaterialGetMaterialAsNewsResponse : CgibinMaterialGetMaterialResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Article
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息缩略图媒体文件标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("thumb_media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("thumb_media_id")]
|
||||
public string ThumbnailMediaId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息缩略图 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("thumb_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("thumb_url")]
|
||||
public string ThumbnailUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息标题。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string Title { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息作者。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("author")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("author")]
|
||||
public string Author { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息摘要。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("digest")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("digest")]
|
||||
public string Digest { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息阅读原文 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("content_source_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("content_source_url")]
|
||||
public string ContentSourceUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息页面的内容。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("content")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("content")]
|
||||
public string Content { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息页面的 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string Url { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否显示封面。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("show_cover_pic")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("show_cover_pic")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanConverter))]
|
||||
public bool IsShowCover { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否打开评论。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("need_open_comment")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("need_open_comment")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanConverter))]
|
||||
public bool? IsOpenComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否粉丝才可评论。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("only_fans_can_comment")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("only_fans_can_comment")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanConverter))]
|
||||
public bool? IsOnlyFansCanComment { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息素材列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("news_item")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("news_item")]
|
||||
public Types.Article[] ArticleList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/material/update_news 接口的请求。</para>
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-02-25 下线。")]
|
||||
public class CgibinMaterialUpdateNewsRequest : WechatApiRequest, IInferable<CgibinMaterialUpdateNewsRequest, CgibinMaterialUpdateNewsResponse>
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Article : CgibinMaterialAddNewsRequest.Types.Article
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置媒体文件标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置要更新的文章在图文消息中的位置(从 0 开始)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("index")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("index")]
|
||||
public int Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置要更新的图文消息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("articles")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("articles")]
|
||||
public Types.Article Article { get; set; } = new Types.Article();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/material/update_news 接口的响应。</para>
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2022-02-25 下线。")]
|
||||
public class CgibinMaterialUpdateNewsResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
@@ -30,10 +29,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class MpNewsMessage : ImageMessage
|
||||
{
|
||||
}
|
||||
|
||||
public class NewsMessage
|
||||
{
|
||||
public static class Types
|
||||
@@ -302,14 +297,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("text")]
|
||||
public Types.TextMessage? MessageContentForText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息内容。
|
||||
/// </summary>
|
||||
[Obsolete("相关接口或字段于 2021-12-31 下线。")]
|
||||
[Newtonsoft.Json.JsonProperty("mpnews")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mpnews")]
|
||||
public Types.MpNewsMessage? MessageContentForMpNews { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文链接消息内容。
|
||||
/// </summary>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"articles": [
|
||||
{
|
||||
"title": "TITLE",
|
||||
"thumb_media_id": "THUMB_MEDIA_ID",
|
||||
"author": "AUTHOR",
|
||||
"digest": "DIGEST",
|
||||
"show_cover_pic": 1,
|
||||
"content": "CONTENT",
|
||||
"content_source_url": "CONTENT_SOURCE_URL",
|
||||
"need_open_comment": 1,
|
||||
"only_fans_can_comment": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"media_id": "MEDIA_ID"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"media_id": "MEDIA_ID"
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"news_item": [
|
||||
{
|
||||
"title": "TITLE",
|
||||
"thumb_media_id": "THUMB_MEDIA_ID",
|
||||
"thumb_url": "thumb_url",
|
||||
"author": "AUTHOR",
|
||||
"digest": "DIGEST",
|
||||
"show_cover_pic": 1,
|
||||
"url": "URL",
|
||||
"content_source_url": "CONTENT_SOURCE_URL"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"media_id": "MEDIA_ID",
|
||||
"index": 0,
|
||||
"articles": {
|
||||
"title": "TITLE",
|
||||
"thumb_media_id": "THUMB_MEDIA_ID",
|
||||
"author": "AUTHOR",
|
||||
"digest": "DIGEST",
|
||||
"show_cover_pic": 1,
|
||||
"content": "CONTENT",
|
||||
"content_source_url": "CONTENT_SOURCE_URL"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
"touser": "OPENID",
|
||||
"msgtype": "type",
|
||||
"text": {
|
||||
@@ -33,9 +33,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"mpnews": {
|
||||
"media_id": "MEDIA_ID"
|
||||
},
|
||||
"msgmenu": {
|
||||
"head_content": "您对本次服务是否满意呢? ",
|
||||
"list": [
|
||||
|
||||
Reference in New Issue
Block a user