mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 14:04:32 +08:00
feat(wxapi): 新增发布能力相关接口
This commit is contained in:
parent
6b693ea2b8
commit
9c42ab19d1
@ -11,7 +11,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
public class EventData
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置顾问微信号。
|
||||
@ -61,6 +61,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
[Newtonsoft.Json.JsonProperty("GuideScanEvent")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("GuideScanEvent")]
|
||||
[System.Xml.Serialization.XmlElement("GuideScanEvent")]
|
||||
public Types.Data EventData { get; set; } = default!;
|
||||
public Types.EventData EventData { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.FREEPUBLISHJOBFINISH 事件的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Publish/Callback_on_finish.html </para>
|
||||
/// </summary>
|
||||
public class FreePublishJobFinishEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class EventData
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ArticleDetail
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Item
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文章索引。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("idx")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("idx")]
|
||||
[System.Xml.Serialization.XmlElement("idx")]
|
||||
public int Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文章 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("article_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("article_url")]
|
||||
[System.Xml.Serialization.XmlElement("article_url")]
|
||||
public string ArticleUrl { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文章数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("count")]
|
||||
[System.Xml.Serialization.XmlElement("count")]
|
||||
public int Count { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文章列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("item")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("item")]
|
||||
[System.Xml.Serialization.XmlArrayItem("item", Type = typeof(Types.Item))]
|
||||
public Types.Item[] List { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("publish_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("publish_id")]
|
||||
[System.Xml.Serialization.XmlElement("publish_id")]
|
||||
public string PublishId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置发布状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("publish_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("publish_status")]
|
||||
[System.Xml.Serialization.XmlElement("publish_status")]
|
||||
public int PublishStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息的 ArticleId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("article_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("article_id")]
|
||||
[System.Xml.Serialization.XmlElement("article_id")]
|
||||
public string? ArticleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息的详细信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("article_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("article_detail")]
|
||||
[System.Xml.Serialization.XmlElement("article_detail")]
|
||||
public Types.ArticleDetail? ArticleDetail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置不通过的文章索引列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fail_idx")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fail_idx")]
|
||||
[System.Xml.Serialization.XmlArrayItem("fail_idx", Type = typeof(int))]
|
||||
public int[]? FailedIndexList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置事件数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("PublishEventInfo")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("PublishEventInfo")]
|
||||
[System.Xml.Serialization.XmlElement("PublishEventInfo")]
|
||||
public Types.EventData EventData { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
{
|
||||
public static class WechatApiClientExecuteCgibinFreePublishExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/freepublish/submit 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Publish/Publish.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinFreePublishSubmitResponse> ExecuteCgibinFreePublishSubmitAsync(this WechatApiClient client, Models.CgibinFreePublishSubmitRequest 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", "freepublish", "submit")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinFreePublishSubmitResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/freepublish/get 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Publish/Get_status.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinFreePublishGetResponse> ExecuteCgibinFreePublishGetAsync(this WechatApiClient client, Models.CgibinFreePublishGetRequest 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", "freepublish", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinFreePublishGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/freepublish/delete 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Publish/Delete_posts.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinFreePublishDeleteResponse> ExecuteCgibinFreePublishDeleteAsync(this WechatApiClient client, Models.CgibinFreePublishDeleteRequest 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", "freepublish", "delete")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinFreePublishDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/freepublish/getarticle 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Publish/Get_article_from_id.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinFreePublishGetArticleResponse> ExecuteCgibinFreePublishGetArticleAsync(this WechatApiClient client, Models.CgibinFreePublishGetArticleRequest 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", "freepublish", "getarticle")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinFreePublishGetArticleResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/freepublish/batchget 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Publish/Get_publication_records.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinFreePublishBatchGetResponse> ExecuteCgibinFreePublishBatchGetAsync(this WechatApiClient client, Models.CgibinFreePublishBatchGetRequest 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", "freepublish", "batchget")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinFreePublishBatchGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Draft
|
||||
public class Item
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
@ -47,18 +47,11 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
public Types.Content? Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置修改时间戳。
|
||||
/// 获取或设置更新时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("update_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
|
||||
public long UpdateTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置创建时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("create_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
|
||||
public long CreateTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,14 +60,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("item")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("item")]
|
||||
public Types.Draft[] DraftList { get; set; } = default!;
|
||||
public Types.Item[] List { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置本次草稿数量。
|
||||
/// 获取或设置本次数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("item_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("item_count")]
|
||||
public int DraftCount { get; set; } = default!;
|
||||
public int Count { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置草稿总数。
|
||||
|
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/freepublish/batchget 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinFreePublishBatchGetRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置分页起始位置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("offset")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("offset")]
|
||||
public int Offset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("count")]
|
||||
public int Limit { get; set; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否不返回内容。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("no_content")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("no_content")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))]
|
||||
public bool? RequireNoContent { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/freepublish/batchget 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinFreePublishBatchGetResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Item
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Content
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Article : CgibinFreePublishGetArticleResponse.Types.Article
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置草稿图文消息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("news_item")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("news_item")]
|
||||
public Types.Article[] ArticleList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息的 ArticleId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("article_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("article_id")]
|
||||
public string ArticleId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置草稿内容。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("content")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("content")]
|
||||
public Types.Content? Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置更新时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("update_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
|
||||
public long UpdateTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("item")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("item")]
|
||||
public Types.Item[] List { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置本次数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("item_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("item_count")]
|
||||
public int Count { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置草稿总数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total_count")]
|
||||
public int TotalCount { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/freepublish/delete 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinFreePublishDeleteRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息的 ArticleId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("article_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("article_id")]
|
||||
public string ArticleId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置要删除的文章在图文消息中的索引。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("index")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("index")]
|
||||
public int? Index { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/freepublish/delete 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinFreePublishDeleteResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/freepublish/getarticle 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinFreePublishGetArticleRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息的 ArticleId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("article_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("article_id")]
|
||||
public string ArticleId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/freepublish/getarticle 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinFreePublishGetArticleResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Article : CgibinDraftGetResponse.Types.Article
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置是否已删除。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("is_deleted")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("is_deleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("news_item")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("news_item")]
|
||||
public Types.Article[] ArticleList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/freepublish/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinFreePublishGetRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置发布任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("publish_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("publish_id")]
|
||||
public string PublishId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/freepublish/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinFreePublishGetResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ArticleDetail
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Item
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文章索引。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("idx")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("idx")]
|
||||
public int Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文章 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("article_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("article_url")]
|
||||
public string ArticleUrl { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文章数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("count")]
|
||||
public int Count { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文章列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("item")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("item")]
|
||||
public Types.Item[] List { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置发布任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("publish_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("publish_id")]
|
||||
public string PublishId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置发布状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("publish_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("publish_status")]
|
||||
public int PublishStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息的 ArticleId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("article_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("article_id")]
|
||||
public string? ArticleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息的详细信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("article_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("article_detail")]
|
||||
public Types.ArticleDetail? ArticleDetail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置不通过的文章索引列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fail_idx")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fail_idx")]
|
||||
public int[]? FailedIndexList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/freepublish/submit 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinFreePublishSubmitRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置草稿的 MediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/freepublish/submit 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinFreePublishSubmitResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置发布任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("publish_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("publish_id")]
|
||||
public string PublishId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<xml>
|
||||
<ToUserName><![CDATA[gh_4d00ed8d6399]]></ToUserName>
|
||||
<FromUserName><![CDATA[oV5CrjpxgaGXNHIQigzNlgLTnwic]]></FromUserName>
|
||||
<CreateTime>1481013459</CreateTime>
|
||||
<MsgType><![CDATA[event]]></MsgType>
|
||||
<Event><![CDATA[FREEPUBLISHJOBFINISH]]></Event>
|
||||
<PublishEventInfo>
|
||||
<publish_id>2247503051</publish_id>
|
||||
<publish_status>0</publish_status>
|
||||
<article_id>
|
||||
<![CDATA[b5O2OUs25HBxRceL7hfReg-U9QGeq9zQjiDvyWP4Hq4]]>
|
||||
</article_id>
|
||||
<article_detail>
|
||||
<count>1</count>
|
||||
<item>
|
||||
<idx>1</idx>
|
||||
<article_url><![CDATA[ARTICLE_URL]]></article_url>
|
||||
</item>
|
||||
</article_detail>
|
||||
<fail_idx>1</fail_idx>
|
||||
<fail_idx>2</fail_idx>
|
||||
</PublishEventInfo>
|
||||
</xml>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"offset": 0,
|
||||
"count": 0,
|
||||
"no_content": 0
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
{
|
||||
"total_count": 0,
|
||||
"item_count": 0,
|
||||
"item": [
|
||||
{
|
||||
"article_id": "ARTICLE_ID",
|
||||
"content": {
|
||||
"news_item": [
|
||||
{
|
||||
"title": "TITLE",
|
||||
"author": "AUTHOR",
|
||||
"digest": "DIGEST",
|
||||
"content": "CONTENT",
|
||||
"content_source_url": "CONTENT_SOURCE_URL",
|
||||
"thumb_media_id": "THUMB_MEDIA_ID",
|
||||
"show_cover_pic": 1,
|
||||
"need_open_comment": 0,
|
||||
"only_fans_can_comment": 0,
|
||||
"url": "URL",
|
||||
"is_deleted": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"update_time": 0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"article_id": "ARTICLE_ID",
|
||||
"index": 1
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ERRMSG"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"article_id": "ARTICLE_ID"
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"news_item": [
|
||||
{
|
||||
"title": "TITLE",
|
||||
"author": "AUTHOR",
|
||||
"digest": "DIGEST",
|
||||
"content": "CONTENT",
|
||||
"content_source_url": "CONTENT_SOURCE_URL",
|
||||
"thumb_media_id": "THUMB_MEDIA_ID",
|
||||
"show_cover_pic": 1,
|
||||
"need_open_comment": 0,
|
||||
"only_fans_can_comment": 0,
|
||||
"url": "URL",
|
||||
"is_deleted": false
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"publish_id": "100000001"
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
{
|
||||
"publish_id": "100000001",
|
||||
"publish_status": 0,
|
||||
"article_id": "ARTICLE_ID",
|
||||
"article_detail": {
|
||||
"count": 1,
|
||||
"item": [
|
||||
{
|
||||
"idx": 1,
|
||||
"article_url": "ARTICLE_URL"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fail_idx": []
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"media_id": "MEDIA_ID"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"publish_id": "100000001"
|
||||
}
|
Loading…
Reference in New Issue
Block a user