diff --git a/docs/WechatApi/Basic_ModelDefinition.md b/docs/WechatApi/Basic_ModelDefinition.md index a713f23d..05fd5772 100644 --- a/docs/WechatApi/Basic_ModelDefinition.md +++ b/docs/WechatApi/Basic_ModelDefinition.md @@ -89,14 +89,13 @@ | √ | 微信客服 | | | | × | 广告 | | 异构协议,需独立模块 | | √ | 小程序评价 | 行业能力 | | -| √ | 小程序评价 | 行业能力 | | +| √ | 小程序直播 | 行业能力 | | | √ | 微信学生身份快速验证 | 行业能力 | | | √ | 微信物流服务 | 行业能力 | | | × | 乘车码 | 行业能力 | _开发中_ | | √ | 小程序 B2B 门店助手 | 行业能力 | | | √ | 短剧小程序 | 行业能力 | | -| × | 小说小程序 | 行业能力 | _开发中_ | -| √ | 购物订单 | 商业能力 | | +| √ | 小说小程序 | 行业能力 | | | √ | 交易保障 | 商业能力 | | | √ | 小程序推广员 | 商业能力 | | | √ | 交易组件 | 商业能力 | | @@ -107,6 +106,7 @@ | √ | 多端能力 | 多端能力 | | | √ | 服务市场 | 服务市场 | | | √ | 城市服务 | 城市服务 | | +| √ | 付费能力 | 付费能力 | | diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaComment/WxaCommentBadScoreEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaComment/WxaCommentBadScoreEvent.cs new file mode 100644 index 00000000..b46fbf67 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaComment/WxaCommentBadScoreEvent.cs @@ -0,0 +1,34 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.wxa_comment_bad_score 事件的数据。 + /// + /// REF:
+ /// + ///
+ ///
+ public class WxaCommentBadScoreEvent : WechatApiEvent + { + public static class Types + { + public class Result + { + /// + /// 获取或设置评价 ID。 + /// + [Newtonsoft.Json.JsonProperty("comment_id")] + [System.Text.Json.Serialization.JsonPropertyName("comment_id")] + [System.Xml.Serialization.XmlElement("comment_id")] + public string CommentId { get; set; } = default!; + } + } + + /// + /// 获取或设置评价结果信息。 + /// + [Newtonsoft.Json.JsonProperty("result")] + [System.Text.Json.Serialization.JsonPropertyName("result")] + [System.Xml.Serialization.XmlElement("result")] + public Types.Result Result { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaSecBook/SecBookAuditEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaSecBook/SecBookAuditEvent.cs new file mode 100644 index 00000000..f4652674 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaSecBook/SecBookAuditEvent.cs @@ -0,0 +1,69 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.secbook_audit_event 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/novel-api.html#%E5%AE%A1%E6%A0%B8%E7%8A%B6%E6%80%81%E4%BA%8B%E4%BB%B6 + /// + public class SecBookAuditEvent : WechatApiEvent + { + public static class Types + { + public class EventData + { + public static class Types + { + public class AuditDetail + { + /// + /// 获取或设置审核状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + [System.Xml.Serialization.XmlElement("status")] + public int Status { get; set; } + + /// + /// 获取或设置提审时间戳。 + /// + [Newtonsoft.Json.JsonProperty("create_time")] + [System.Text.Json.Serialization.JsonPropertyName("create_time")] + [System.Xml.Serialization.XmlElement("create_time")] + public long CreateTimestamp { get; set; } + + /// + /// 获取或设置审核时间戳。 + /// + [Newtonsoft.Json.JsonProperty("audit_time")] + [System.Text.Json.Serialization.JsonPropertyName("audit_time")] + [System.Xml.Serialization.XmlElement("audit_time")] + public long AuditTimestamp { get; set; } + } + } + + /// + /// 获取或设置作品 ID。 + /// + [Newtonsoft.Json.JsonProperty("book_id")] + [System.Text.Json.Serialization.JsonPropertyName("book_id")] + [System.Xml.Serialization.XmlElement("book_id")] + public string BookId { get; set; } = default!; + + /// + /// 获取或设置审核信息。 + /// + [Newtonsoft.Json.JsonProperty("audit_detail")] + [System.Text.Json.Serialization.JsonPropertyName("audit_detail")] + [System.Xml.Serialization.XmlElement("audit_detail")] + public Types.AuditDetail AuditDetail { get; set; } = default!; + } + } + + /// + /// 获取或设置事件信息。 + /// + [Newtonsoft.Json.JsonProperty("audit_event")] + [System.Text.Json.Serialization.JsonPropertyName("audit_event")] + [System.Xml.Serialization.XmlElement("audit_event")] + public Types.EventData EventData { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaSecVod/SecVodAuditEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaSecVod/SecVodAuditEvent.cs index bc19ce1c..6559896b 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaSecVod/SecVodAuditEvent.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaSecVod/SecVodAuditEvent.cs @@ -44,7 +44,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events [Newtonsoft.Json.JsonProperty("audit_time")] [System.Text.Json.Serialization.JsonPropertyName("audit_time")] [System.Xml.Serialization.XmlElement("audit_time")] - public long? AuditTimestamp { get; set; } + public long AuditTimestamp { get; set; } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/XPay/XPayRefundNotifyEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/XPay/XPayRefundNotifyEvent.cs index 2117726a..95d85aab 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/XPay/XPayRefundNotifyEvent.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/XPay/XPayRefundNotifyEvent.cs @@ -44,7 +44,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events [Newtonsoft.Json.JsonProperty("WxOrderId")] [System.Text.Json.Serialization.JsonPropertyName("WxOrderId")] [System.Xml.Serialization.XmlElement("WxOrderId")] - public string WechatpayOrderId { get; set; } = default!; + public string WechatpayTransactionId { get; set; } = default!; /// /// 获取或设置退款单的微信支付单号。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaApiExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaApiExtensions.cs index 9e7472b5..71a9df0d 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaApiExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaApiExtensions.cs @@ -9,6 +9,152 @@ namespace SKIT.FlurlHttpClient.Wechat.Api { public static class WechatApiClientExecuteWxaApiExtensions { + #region Comment + /// + /// 异步调用 [GET] /wxaapi/comment/mpcommentlist/get 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteWxaApiCommentMpCommentListGetAsync(this WechatApiClient client, Models.WxaApiCommentMpCommentListGetRequest 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, "wxaapi", "comment", "mpcommentlist", "get") + .SetQueryParam("access_token", request.AccessToken) + .SetQueryParam("startTime", request.StartTimestamp) + .SetQueryParam("endTime", request.EndTimestamp) + .SetQueryParam("filterType", request.FilterType) + .SetQueryParam("offset", request.Offset) + .SetQueryParam("limit", request.Limit); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [GET] /wxaapi/comment/replyandcommentreplylist/get 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteWxaApiCommentReplyAndCommentReplyListGetAsync(this WechatApiClient client, Models.WxaApiCommentReplyAndCommentReplyListGetRequest 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, "wxaapi", "comment", "replyandcommentreplylist", "get") + .SetQueryParam("access_token", request.AccessToken) + .SetQueryParam("commentId", request.CommentId); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /wxaapi/comment/commentreply/add 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteWxaApiCommentReplyAddAsync(this WechatApiClient client, Models.WxaApiCommentReplyAddRequest 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, "wxaapi", "comment", "reply", "add") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /wxaapi/comment/commentreply/delete 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteWxaApiCommentReplyDeleteAsync(this WechatApiClient client, Models.WxaApiCommentReplyDeleteRequest 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, "wxaapi", "comment", "reply", "delete") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /wxaapi/comment/apikfquota/reset 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteWxaApiCommentApiKfQuotaResetAsync(this WechatApiClient client, Models.WxaApiCommentApiKfQuotaResetRequest 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, "wxaapi", "comment", "apikfquota", "reset") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /wxaapi/comment/confirmcompromise 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteWxaApiCommentConfirmCompromiseAsync(this WechatApiClient client, Models.WxaApiCommentConfirmCompromiseRequest 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, "wxaapi", "comment", "confirmcompromise") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #endregion + #region NewTemplate /// /// 异步调用 [POST] /wxaapi/newtmpl/addtemplate 接口。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentApiKfQuotaResetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentApiKfQuotaResetRequest.cs new file mode 100644 index 00000000..75e6e28b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentApiKfQuotaResetRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/comment/apikfquota/reset 接口的请求。 + /// + public class WxaApiCommentApiKfQuotaResetRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置评价 ID。 + /// + [Newtonsoft.Json.JsonProperty("commentId")] + [System.Text.Json.Serialization.JsonPropertyName("commentId")] + public string CommentId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentApiKfQuotaResetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentApiKfQuotaResetResponse.cs new file mode 100644 index 00000000..df87a4be --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentApiKfQuotaResetResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/comment/apikfquota/reset 接口的响应。 + /// + public class WxaApiCommentApiKfQuotaResetResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentConfirmCompromiseRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentConfirmCompromiseRequest.cs new file mode 100644 index 00000000..31b07a0f --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentConfirmCompromiseRequest.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/comment/confirmcompromise 接口的请求。 + /// + public class WxaApiCommentConfirmCompromiseRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置评价 ID。 + /// + [Newtonsoft.Json.JsonProperty("commentId")] + [System.Text.Json.Serialization.JsonPropertyName("commentId")] + public string CommentId { get; set; } = string.Empty; + + /// + /// 获取或设置和解的图片 MediaId 列表。 + /// + [Newtonsoft.Json.JsonProperty("picList")] + [System.Text.Json.Serialization.JsonPropertyName("picList")] + public IList? PictureMediaIdList { get; set; } + + /// + /// 获取或设置和解的文本内容。 + /// + [Newtonsoft.Json.JsonProperty("content")] + [System.Text.Json.Serialization.JsonPropertyName("content")] + public string? Content { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentConfirmCompromiseResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentConfirmCompromiseResponse.cs new file mode 100644 index 00000000..be697e2d --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentConfirmCompromiseResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/comment/confirmcompromise 接口的响应。 + /// + public class WxaApiCommentConfirmCompromiseResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentMpCommentListGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentMpCommentListGetRequest.cs new file mode 100644 index 00000000..32f440dd --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentMpCommentListGetRequest.cs @@ -0,0 +1,43 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxaapi/comment/mpcommentlist/get 接口的请求。 + /// + public class WxaApiCommentMpCommentListGetRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置查询时间段的开始时间戳。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public long StartTimestamp { get; set; } + + /// + /// 获取或设置查询时间段的结束时间戳。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public long EndTimestamp { get; set; } + + /// + /// 获取或设置过滤的数据类型。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public int? FilterType { get; set; } + + /// + /// 获取或设置分页起始位置。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public int? Offset { get; set; } + + /// + /// 获取或设置分页每页数量。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public int? Limit { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentMpCommentListGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentMpCommentListGetResponse.cs new file mode 100644 index 00000000..7baf2fab --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentMpCommentListGetResponse.cs @@ -0,0 +1,287 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxaapi/comment/mpcommentlist/get 接口的响应。 + /// + public class WxaApiCommentMpCommentListGetResponse : WechatApiResponse + { + public static class Types + { + public class Comment + { + public static class Types + { + public class OrderInfo + { + /// + /// 获取或设置商户单号。 + /// + [Newtonsoft.Json.JsonProperty("busiOrderId")] + [System.Text.Json.Serialization.JsonPropertyName("busiOrderId")] + public string BusinessOrderId { get; set; } = default!; + } + + public class UserInfo + { + /// + /// 获取或设置用户的 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("openid")] + [System.Text.Json.Serialization.JsonPropertyName("openid")] + public string OpenId { get; set; } = default!; + + /// + /// 获取或设置用户的昵称。 + /// + [Newtonsoft.Json.JsonProperty("nickName")] + [System.Text.Json.Serialization.JsonPropertyName("nickName")] + public string Nickname { get; set; } = default!; + + /// + /// 获取或设置用户的头像 URL。 + /// + [Newtonsoft.Json.JsonProperty("headImg")] + [System.Text.Json.Serialization.JsonPropertyName("headImg")] + public string HeadImageUrl { get; set; } = default!; + } + + public class BusinessInfo + { + /// + /// 获取或设置小程序的 AppId。 + /// + [Newtonsoft.Json.JsonProperty("appid")] + [System.Text.Json.Serialization.JsonPropertyName("appid")] + public string OpenId { get; set; } = default!; + + /// + /// 获取或设置小程序的昵称。 + /// + [Newtonsoft.Json.JsonProperty("nickName")] + [System.Text.Json.Serialization.JsonPropertyName("nickName")] + public string Nickname { get; set; } = default!; + + /// + /// 获取或设置小程序的头像 URL。 + /// + [Newtonsoft.Json.JsonProperty("headImg")] + [System.Text.Json.Serialization.JsonPropertyName("headImg")] + public string HeadImageUrl { get; set; } = default!; + } + + public class ContentInfo + { + public static class Types + { + public class Media + { + /// + /// 获取或设置图片 URL。 + /// + [Newtonsoft.Json.JsonProperty("img")] + [System.Text.Json.Serialization.JsonPropertyName("img")] + public string? ImageUrl { get; set; } + + /// + /// 获取或设置缩略图 URL。 + /// + [Newtonsoft.Json.JsonProperty("thumbImg")] + [System.Text.Json.Serialization.JsonPropertyName("thumbImg")] + public string? ImageThumbnailUrl { get; set; } + + /// + /// 获取或设置视频 URL。 + /// + [Newtonsoft.Json.JsonProperty("video")] + [System.Text.Json.Serialization.JsonPropertyName("video")] + public string? VideoUrl { get; set; } + + /// + /// 获取或设置视频封面 URL。 + /// + [Newtonsoft.Json.JsonProperty("videoCover")] + [System.Text.Json.Serialization.JsonPropertyName("videoCover")] + public string? VideoCoverUrl { get; set; } + + /// + /// 获取或设置视频时长(单位:秒)。 + /// + [Newtonsoft.Json.JsonProperty("videoDuration")] + [System.Text.Json.Serialization.JsonPropertyName("videoDuration")] + public int? VideoDuration { get; set; } + } + } + + /// + /// 获取或设置评价内容。 + /// + [Newtonsoft.Json.JsonProperty("txt")] + [System.Text.Json.Serialization.JsonPropertyName("txt")] + public string Text { get; set; } = default!; + + /// + /// 获取或设置媒体文件列表。 + /// + [Newtonsoft.Json.JsonProperty("media")] + [System.Text.Json.Serialization.JsonPropertyName("media")] + public Types.Media[]? MediaList { get; set; } + } + + public class ExtraInfo + { + /// + /// 获取或设置是否已发过差评客服会话。 + /// + [Newtonsoft.Json.JsonProperty("isAlreadySendTmpl")] + [System.Text.Json.Serialization.JsonPropertyName("isAlreadySendTmpl")] + public bool IsAlreadySendTemplate { get; set; } + } + + public class ProductInfo + { + public static class Types + { + public class Product + { + /// + /// 获取或设置商品名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + public string Name { get; set; } = default!; + + /// + /// 获取或设置商品图片 URL。 + /// + [Newtonsoft.Json.JsonProperty("picUrl")] + [System.Text.Json.Serialization.JsonPropertyName("picUrl")] + public string PictureUrl { get; set; } = default!; + } + } + + /// + /// 获取或设置商品列表。 + /// + [Newtonsoft.Json.JsonProperty("productList")] + [System.Text.Json.Serialization.JsonPropertyName("productList")] + public Types.Product[] ProductList { get; set; } = default!; + } + } + + /// + /// 获取或设置评价 ID。 + /// + [Newtonsoft.Json.JsonProperty("commentId")] + [System.Text.Json.Serialization.JsonPropertyName("commentId")] + public string CommentId { get; set; } = default!; + + /// + /// 获取或设置金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("amount")] + [System.Text.Json.Serialization.JsonPropertyName("amount")] + public int Amount { get; set; } + + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("orderId")] + [System.Text.Json.Serialization.JsonPropertyName("orderId")] + public string OrderId { get; set; } = default!; + + /// + /// 获取或设置微信支付订单号。 + /// + [Newtonsoft.Json.JsonProperty("wxPayId")] + [System.Text.Json.Serialization.JsonPropertyName("wxPayId")] + public string WechatpayTransactionId { get; set; } = default!; + + /// + /// 获取或设置支付时间戳。 + /// + [Newtonsoft.Json.JsonProperty("payTime")] + [System.Text.Json.Serialization.JsonPropertyName("payTime")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long PayTimestamp { get; set; } + + /// + /// 获取或设置创建时间戳。 + /// + [Newtonsoft.Json.JsonProperty("createTime")] + [System.Text.Json.Serialization.JsonPropertyName("createTime")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long CreateTimestamp { get; set; } + + /// + /// 获取或设置评价分数。 + /// + [Newtonsoft.Json.JsonProperty("score")] + [System.Text.Json.Serialization.JsonPropertyName("score")] + public int Score { get; set; } + + /// + /// 获取或设置评价商品信息。 + /// + [Newtonsoft.Json.JsonProperty("productInfo")] + [System.Text.Json.Serialization.JsonPropertyName("productInfo")] + public Types.ProductInfo ProductInfo { get; set; } = default!; + + /// + /// 获取或设置商家订单信息。 + /// + [Newtonsoft.Json.JsonProperty("orderInfo")] + [System.Text.Json.Serialization.JsonPropertyName("orderInfo")] + public Types.OrderInfo? OrderInfo { get; set; } + + /// + /// 获取或设置评价订单信息。 + /// + [Newtonsoft.Json.JsonProperty("userInfo")] + [System.Text.Json.Serialization.JsonPropertyName("userInfo")] + public Types.UserInfo? UserInfo { get; set; } + + /// + /// 获取或设置商家小程序信息。 + /// + [Newtonsoft.Json.JsonProperty("bizInfo")] + [System.Text.Json.Serialization.JsonPropertyName("bizInfo")] + public Types.BusinessInfo? BusinessInfo { get; set; } + + /// + /// 获取或设置评价内容信息。 + /// + [Newtonsoft.Json.JsonProperty("content")] + [System.Text.Json.Serialization.JsonPropertyName("content")] + public Types.ContentInfo ContentInfo { get; set; } = default!; + + /// + /// 获取或设置评价额外信息。 + /// + [Newtonsoft.Json.JsonProperty("extInfo")] + [System.Text.Json.Serialization.JsonPropertyName("extInfo")] + public Types.ExtraInfo ExtraInfo { get; set; } = default!; + } + } + + /// + /// 获取或设置评价列表。 + /// + [Newtonsoft.Json.JsonProperty("commentList")] + [System.Text.Json.Serialization.JsonPropertyName("commentList")] + public Types.Comment[] CommentList { get; set; } = default!; + + /// + /// 获取或设置评价总数量。 + /// + [Newtonsoft.Json.JsonProperty("total")] + [System.Text.Json.Serialization.JsonPropertyName("total")] + public int TotalCount { get; set; } + + /// + /// 获取或设置分页起始位置。 + /// + [Newtonsoft.Json.JsonProperty("offset")] + [System.Text.Json.Serialization.JsonPropertyName("offset")] + public int? Offset { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAddRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAddRequest.cs new file mode 100644 index 00000000..1c8cfc1a --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAddRequest.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/comment/commentreply/add 接口的请求。 + /// + public class WxaApiCommentReplyAddRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置评价 ID。 + /// + [Newtonsoft.Json.JsonProperty("commentId")] + [System.Text.Json.Serialization.JsonPropertyName("commentId")] + public string CommentId { get; set; } = string.Empty; + + /// + /// 获取或设置评论的内容。 + /// + [Newtonsoft.Json.JsonProperty("content")] + [System.Text.Json.Serialization.JsonPropertyName("content")] + public string Content { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAddResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAddResponse.cs new file mode 100644 index 00000000..3f913ac3 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAddResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/comment/commentreply/add 接口的响应。 + /// + public class WxaApiCommentReplyAddResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAndCommentReplyListGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAndCommentReplyListGetRequest.cs new file mode 100644 index 00000000..15fb62b2 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAndCommentReplyListGetRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxaapi/comment/replyandcommentreplylist/get 接口的请求。 + /// + public class WxaApiCommentReplyAndCommentReplyListGetRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置评价 ID。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string CommentId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAndCommentReplyListGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAndCommentReplyListGetResponse.cs new file mode 100644 index 00000000..d57e8e44 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyAndCommentReplyListGetResponse.cs @@ -0,0 +1,173 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxaapi/comment/replyandcommentreplylist/get 接口的响应。 + /// + public class WxaApiCommentReplyAndCommentReplyListGetResponse : WechatApiResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class Reply + { + public static class Types + { + public class ContentInfo + { + /// + /// 获取或设置内容。 + /// + [Newtonsoft.Json.JsonProperty("content")] + [System.Text.Json.Serialization.JsonPropertyName("content")] + public string Content { get; set; } = default!; + } + + public class UserInfo + { + /// + /// 获取或设置昵称。 + /// + [Newtonsoft.Json.JsonProperty("nickname")] + [System.Text.Json.Serialization.JsonPropertyName("nickname")] + public string Nickname { get; set; } = default!; + + /// + /// 获取或设置头像 URL。 + /// + [Newtonsoft.Json.JsonProperty("imgUrl")] + [System.Text.Json.Serialization.JsonPropertyName("imgUrl")] + public string HeadImageUrl { get; set; } = default!; + } + } + + /// + /// 获取或设置评论 ID。 + /// + [Newtonsoft.Json.JsonProperty("replyId")] + [System.Text.Json.Serialization.JsonPropertyName("replyId")] + public string ReplyId { get; set; } = default!; + + /// + /// 获取或设置评价 ID。 + /// + [Newtonsoft.Json.JsonProperty("commentId")] + [System.Text.Json.Serialization.JsonPropertyName("commentId")] + public string CommentId { get; set; } = default!; + + /// + /// 获取或设置评论内容信息。 + /// + [Newtonsoft.Json.JsonProperty("replyContent")] + [System.Text.Json.Serialization.JsonPropertyName("replyContent")] + public Types.ContentInfo ContentInfo { get; set; } = default!; + + /// + /// 获取或设置评论用户信息。 + /// + [Newtonsoft.Json.JsonProperty("replyObject")] + [System.Text.Json.Serialization.JsonPropertyName("replyObject")] + public Types.UserInfo UserInfo { get; set; } = default!; + + /// + /// 获取或设置创建时间戳。 + /// + [Newtonsoft.Json.JsonProperty("createTime")] + [System.Text.Json.Serialization.JsonPropertyName("createTime")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long CreateTimestamp { get; set; } + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("updateTime")] + [System.Text.Json.Serialization.JsonPropertyName("updateTime")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long UpdateTimestamp { get; set; } + } + + public class CommentReply + { + public static class Types + { + public class ContentInfo : Reply.Types.ContentInfo + { + } + + public class UserInfo : Reply.Types.UserInfo + { + } + } + + /// + /// 获取或设置回复 ID。 + /// + [Newtonsoft.Json.JsonProperty("commentReplyId")] + [System.Text.Json.Serialization.JsonPropertyName("commentReplyId")] + public string CommentReplyId { get; set; } = default!; + + /// + /// 获取或设置评价 ID。 + /// + [Newtonsoft.Json.JsonProperty("commentId")] + [System.Text.Json.Serialization.JsonPropertyName("commentId")] + public string CommentId { get; set; } = default!; + + /// + /// 获取或设置评论内容信息。 + /// + [Newtonsoft.Json.JsonProperty("commentReplyContent")] + [System.Text.Json.Serialization.JsonPropertyName("commentReplyContent")] + public Types.ContentInfo ContentInfo { get; set; } = default!; + + /// + /// 获取或设置评论用户信息。 + /// + [Newtonsoft.Json.JsonProperty("commentReplyObject")] + [System.Text.Json.Serialization.JsonPropertyName("commentReplyObject")] + public Types.UserInfo UserInfo { get; set; } = default!; + + /// + /// 获取或设置创建时间戳。 + /// + [Newtonsoft.Json.JsonProperty("createTime")] + [System.Text.Json.Serialization.JsonPropertyName("createTime")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long CreateTimestamp { get; set; } + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("updateTime")] + [System.Text.Json.Serialization.JsonPropertyName("updateTime")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long UpdateTimestamp { get; set; } + } + } + + /// + /// 获取或设置评论信息。 + /// + [Newtonsoft.Json.JsonProperty("reply")] + [System.Text.Json.Serialization.JsonPropertyName("reply")] + public Types.Reply Reply { get; set; } = default!; + + /// + /// 获取或设置评论回复列表。 + /// + [Newtonsoft.Json.JsonProperty("commentReplyList")] + [System.Text.Json.Serialization.JsonPropertyName("commentReplyList")] + public Types.CommentReply[] CommentReplyList { get; set; } = default!; + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("list")] + [System.Text.Json.Serialization.JsonPropertyName("list")] + public Types.Data Data { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyDeleteRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyDeleteRequest.cs new file mode 100644 index 00000000..58488b6b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyDeleteRequest.cs @@ -0,0 +1,29 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/comment/commentreply/delete 接口的请求。 + /// + public class WxaApiCommentReplyDeleteRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置评价 ID。 + /// + [Newtonsoft.Json.JsonProperty("commentId")] + [System.Text.Json.Serialization.JsonPropertyName("commentId")] + public string CommentId { get; set; } = string.Empty; + + /// + /// 获取或设置评论 ID。 + /// + [Newtonsoft.Json.JsonProperty("replyId")] + [System.Text.Json.Serialization.JsonPropertyName("replyId")] + public string ReplyId { get; set; } = string.Empty; + + /// + /// 获取或设置评论回复 ID。 + /// + [Newtonsoft.Json.JsonProperty("commentReplyId")] + [System.Text.Json.Serialization.JsonPropertyName("commentReplyId")] + public string CommentReplyId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyDeleteResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyDeleteResponse.cs new file mode 100644 index 00000000..c7494927 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Comment/WxaApiCommentReplyDeleteResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/comment/commentreply/delete 接口的响应。 + /// + public class WxaApiCommentReplyDeleteResponse : WechatApiResponse + { + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/WxaComment/WxaCommentBadScoreEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/WxaComment/WxaCommentBadScoreEvent.xml new file mode 100644 index 00000000..052c8b1d --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/WxaComment/WxaCommentBadScoreEvent.xml @@ -0,0 +1,10 @@ + + + + 1704038400 + + + + 2272502024443330610 + + diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/WxaSecBook/SecBookAuditEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/WxaSecBook/SecBookAuditEvent.xml new file mode 100644 index 00000000..1b9a83ff --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/WxaSecBook/SecBookAuditEvent.xml @@ -0,0 +1,15 @@ + + gh_abcdefg + oABCD + 12344555555 + event + secbook_audit_event + + A1b2C3d4 + + 3 + 168625255 + 168626255 + + + diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentApiKfQuotaResetRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentApiKfQuotaResetRequest.json new file mode 100644 index 00000000..9f3e2e2b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentApiKfQuotaResetRequest.json @@ -0,0 +1,3 @@ +{ + "commentId": "xxxxxxxxxx" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentConfirmCompromiseRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentConfirmCompromiseRequest.json new file mode 100644 index 00000000..0a528898 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentConfirmCompromiseRequest.json @@ -0,0 +1,5 @@ +{ + "commentId": "xxxxxxxxxx", + "picList": [ "mediaid", "mediaid" ], + "content": "我是和解的内容" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentMpCommentListGetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentMpCommentListGetResponse.json new file mode 100644 index 00000000..fe85a89d --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentMpCommentListGetResponse.json @@ -0,0 +1,49 @@ +{ + "errcode": 0, + "commentList": [ + { + "commentId": "2797755680173111111", + "amount": 100, + "orderId": "payorder@_4200001761202302096311111111", + "payTime": "1675915718", + "wxPayId": "4200001761202302096311111111", + "orderInfo": { + "busiOrderId": "xxxxxx" + }, + "userInfo": { + "openid": "xxxxxxxxxx", + "headImg": "http://wx.qlogo.cn/mmhead/xxxxxxxxxxx", + "nickName": "test" + }, + "bizInfo": { + "appid": "wx1234567890", + "headImg": "http://wx.qlogo.cn/mmhead/xxxxxxxxxxxx", + "nickName": "xxx" + }, + "score": 200, + "createTime": "1676351504", + "content": { + "media": [ + { + "img": "http://xxx", + "thumbImg": "http://xxx" + } + ], + "txt": "一般吧 我总感觉这个成分很伤皮肤,用了之后一直很干燥,不是很喜欢这款产品" + }, + "extInfo": { + "isAlreadySendTmpl": false + }, + "productInfo": { + "productList": [ + { + "name": "纸巾一张", + "picUrl": "https://xxxxxx" + } + ] + } + } + ], + "total": 3, + "offset": 0 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentReplyAddRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentReplyAddRequest.json new file mode 100644 index 00000000..fd0d5c5b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentReplyAddRequest.json @@ -0,0 +1,4 @@ +{ + "commentId": "xxxxxxxxxx", + "content": "我是内容" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentReplyAndCommentReplyListGetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentReplyAndCommentReplyListGetResponse.json new file mode 100644 index 00000000..3eaa8270 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentReplyAndCommentReplyListGetResponse.json @@ -0,0 +1,29 @@ +{ + "errcode": 0, + "list": { + "reply": { + "commentId": "123", + "replyId": "1", + "createTime": "1669032337", + "updateTime": "1669032341", + "replyContent": { "content": "999" }, + "replyObject": { + "nickname": "小程序名称", + "imgUrl": "http://xxx/xx" + } + }, + "commentReplyList": [ + { + "commentId": "12345", + "commentReplyId": "1", + "createTime": "1669032388", + "updateTime": "1669032392", + "commentReplyContent": { "content": "uuuuuuuuu" }, + "commentReplyObject": { + "nickname": "啊哈", + "imgUrl": "xxx" + } + } + ] + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentReplyDeleteRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentReplyDeleteRequest.json new file mode 100644 index 00000000..6305315e --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/Comment/WxaApiCommentReplyDeleteRequest.json @@ -0,0 +1,5 @@ +{ + "commentId": "xxxxxxxxxx", + "replyId": "xxxxx", + "commentReplyId": "xxxxx" +}