From 10ab0af625bc28f9f6c196bde0e6ad975dff0ee2 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Wed, 15 Dec 2021 17:29:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(wxapi):=20=E6=96=B0=E5=A2=9E=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E7=94=A8=E6=88=B7=E4=BA=A4=E6=98=93=E7=B1=BB?= =?UTF-8?q?=E6=8A=95=E8=AF=89=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WxaMiniShop/ComplaintCallbackEvent.cs | 178 +++++++++++++++ .../WechatApiClientExecuteWxaApiExtensions.cs | 83 +++++++ ...CgibinMessageDeviceSubscribeSendRequest.cs | 4 +- ...MiniShopBusinessRespondComplaintRequest.cs | 38 ++++ ...iniShopBusinessRespondComplaintResponse.cs | 9 + ...xaApiMiniShopBusinessSupplyProofRequest.cs | 31 +++ ...aApiMiniShopBusinessSupplyProofResponse.cs | 9 + ...aApiMiniShopBusinessSupplyRefundRequest.cs | 9 + ...ApiMiniShopBusinessSupplyRefundResponse.cs | 9 + ...aApiMiniShopComplaintOrderDetailRequest.cs | 15 ++ ...ApiMiniShopComplaintOrderDetailResponse.cs | 211 ++++++++++++++++++ .../WxaMiniShop/ComplaintCallbackEvent.xml | 30 +++ ...ibinMessageDeviceSubscribeSendRequest.json | 18 +- ...CgibinMessageTemplateSubscribeRequest.json | 4 - ...niShopBusinessRespondComplaintRequest.json | 6 + ...iShopBusinessRespondComplaintResponse.json | 3 + ...ApiMiniShopBusinessSupplyProofRequest.json | 5 + ...piMiniShopBusinessSupplyProofResponse.json | 3 + ...piMiniShopComplaintOrderDetailRequest.json | 1 + ...iMiniShopComplaintOrderDetailResponse.json | 36 +++ 20 files changed, 684 insertions(+), 18 deletions(-) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaMiniShop/ComplaintCallbackEvent.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyRefundRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyRefundResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/WxaMiniShop/ComplaintCallbackEvent.xml create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailResponse.json diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaMiniShop/ComplaintCallbackEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaMiniShop/ComplaintCallbackEvent.cs new file mode 100644 index 00000000..6d33a240 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/WxaMiniShop/ComplaintCallbackEvent.cs @@ -0,0 +1,178 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.complaint_callback 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/complaint.html + /// + public class ComplaintCallbackEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class ComplaintHistory + { + /// + /// 获取或设置时间戳。 + /// + [Newtonsoft.Json.JsonProperty("time")] + [System.Text.Json.Serialization.JsonPropertyName("time")] + [System.Xml.Serialization.XmlElement("time")] + public long Timestamp { get; set; } + + /// + /// 获取或设置内容。 + /// + [Newtonsoft.Json.JsonProperty("content")] + [System.Text.Json.Serialization.JsonPropertyName("content")] + [System.Xml.Serialization.XmlElement("content", IsNullable = true)] + public string? Content { get; set; } + + /// + /// 获取或设置图片 MediaId 列表字符串(以逗号分隔)。 + /// + [Newtonsoft.Json.JsonProperty("media_id_list")] + [System.Text.Json.Serialization.JsonPropertyName("media_id_list")] + [System.Xml.Serialization.XmlElement("media_id_list", IsNullable = true)] + public string? MediaIdListString { get; set; } + } + } + + /// + /// 获取或设置小程序 AppId。 + /// + [Newtonsoft.Json.JsonProperty("appid")] + [System.Text.Json.Serialization.JsonPropertyName("appid")] + [System.Xml.Serialization.XmlElement("appid")] + public string AppId { get; set; } = default!; + + /// + /// 获取或设置事件通知类型。 + /// + [Newtonsoft.Json.JsonProperty("option_type")] + [System.Text.Json.Serialization.JsonPropertyName("option_type")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))] + [System.Xml.Serialization.XmlElement("option_type")] + public string OptionType { get; set; } = default!; + + /// + /// 获取或设置投诉单号。 + /// + [Newtonsoft.Json.JsonProperty("complaint_order_id")] + [System.Text.Json.Serialization.JsonPropertyName("complaint_order_id")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + [System.Xml.Serialization.XmlElement("complaint_order_id")] + public string ComplaintOrderId { get; set; } = default!; + + /// + /// 获取或设置用户 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("open_id")] + [System.Text.Json.Serialization.JsonPropertyName("open_id")] + [System.Xml.Serialization.XmlElement("open_id")] + public string OpenId { get; set; } = default!; + + /// + /// 获取或设置投诉问题类型。 + /// + [Newtonsoft.Json.JsonProperty("type")] + [System.Text.Json.Serialization.JsonPropertyName("type")] + [System.Xml.Serialization.XmlElement("type")] + public int Type { get; set; } + + /// + /// 获取或设置订单状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + [System.Xml.Serialization.XmlElement("status")] + public int Status { get; set; } + + /// + /// 获取或设置用户手机号码。 + /// + [Newtonsoft.Json.JsonProperty("phone_number")] + [System.Text.Json.Serialization.JsonPropertyName("phone_number")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringConverter))] + [System.Xml.Serialization.XmlElement("phone_number")] + public string PhoneNumber { get; set; } = default!; + + /// + /// 获取或设置投诉材料内容。 + /// + [Newtonsoft.Json.JsonProperty("customer_material_content")] + [System.Text.Json.Serialization.JsonPropertyName("customer_material_content")] + [System.Xml.Serialization.XmlElement("customer_material_content", IsNullable = true)] + public string? CustomerMaterialContent { get; set; } + + /// + /// 获取或设置投诉材料图片 MediaId 列表字符串(以逗号分隔)。 + /// + [Newtonsoft.Json.JsonProperty("customer_material_media_id_list")] + [System.Text.Json.Serialization.JsonPropertyName("customer_material_media_id_list")] + [System.Xml.Serialization.XmlElement("customer_material_media_id_list", IsNullable = true)] + public string? CustomerMaterialMediaIdListString { get; set; } + + /// + /// 获取或设置订单号。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + [System.Xml.Serialization.XmlElement("order_id")] + public string OrderId { get; set; } = default!; + + /// + /// 获取或设置商户订单号。 + /// + [Newtonsoft.Json.JsonProperty("out_trade_no")] + [System.Text.Json.Serialization.JsonPropertyName("out_trade_no")] + [System.Xml.Serialization.XmlElement("out_trade_no")] + public string OutTradeNumber { get; set; } = default!; + + /// + /// 获取或设置商品名称。 + /// + [Newtonsoft.Json.JsonProperty("product_name")] + [System.Text.Json.Serialization.JsonPropertyName("product_name")] + [System.Xml.Serialization.XmlElement("product_name")] + public string ProductName { get; set; } = default!; + + /// + /// 获取或设置支付时间戳。 + /// + [Newtonsoft.Json.JsonProperty("pay_time")] + [System.Text.Json.Serialization.JsonPropertyName("pay_time")] + [System.Xml.Serialization.XmlElement("pay_time")] + public long PayTimestamp { get; set; } + + /// + /// 获取或设置交易金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("total_cost")] + [System.Text.Json.Serialization.JsonPropertyName("total_cost")] + [System.Xml.Serialization.XmlElement("total_cost")] + public int TotalCost { get; set; } + + /// + /// 获取或设置投诉发起时间戳。 + /// + [Newtonsoft.Json.JsonProperty("create_time")] + [System.Text.Json.Serialization.JsonPropertyName("create_time")] + [System.Xml.Serialization.XmlElement("create_time")] + public long ComplaintCreateTimestamp { get; set; } + + /// + /// 获取或设置投诉状态过期时间戳。 + /// + [Newtonsoft.Json.JsonProperty("expire_time")] + [System.Text.Json.Serialization.JsonPropertyName("expire_time")] + [System.Xml.Serialization.XmlElement("expire_time")] + public long ComplaintStatusExpireTimestamp { get; set; } + + /// + /// 获取或设置投诉进度列表。 + /// + [Newtonsoft.Json.JsonProperty("history")] + [System.Text.Json.Serialization.JsonPropertyName("history")] + [System.Xml.Serialization.XmlArrayItem("history", Type = typeof(Types.ComplaintHistory))] + public Types.ComplaintHistory[] ComplaintHistoryList { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaApiExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaApiExtensions.cs index 9d41e00f..4496de0b 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaApiExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaApiExtensions.cs @@ -1007,5 +1007,88 @@ namespace SKIT.FlurlHttpClient.Wechat.Api } #endregion #endregion + + #region MiniShop + /// + /// 异步调用 [GET] /wxaapi/minishop/complaintOrderDetail 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/complaint.html + /// + /// + /// + /// + /// + public static async Task ExecuteWxaApiMiniShopComplaintOrderDetailAsync(this WechatApiClient client, Models.WxaApiMiniShopComplaintOrderDetailRequest 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.Get, "wxaapi", "minishop", "complaintOrderDetail") + .SetQueryParam("access_token", request.AccessToken) + .SetQueryParam("complaintOrderId", request.ComplaintOrderId); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxaapi/minishop/bussiRespondComplaint 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/complaint.html + /// + /// + /// + /// + /// + public static async Task ExecuteWxaApiMiniShopBusinessRespondComplaintAsync(this WechatApiClient client, Models.WxaApiMiniShopBusinessRespondComplaintRequest 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, "wxaapi", "minishop", "bussiRespondComplaint") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxaapi/minishop/bussiSupplyProof 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/complaint.html + /// + /// + /// + /// + /// + public static async Task ExecuteWxaApiMiniShopBusinessSupplyProofAsync(this WechatApiClient client, Models.WxaApiMiniShopBusinessSupplyProofRequest 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, "wxaapi", "minishop", "bussiSupplyProof") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxaapi/minishop/bussiSupplyRefund 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/complaint.html + /// + /// + /// + /// + /// + public static async Task ExecuteWxaApiMiniShopBusinessSupplyRefundAsync(this WechatApiClient client, Models.WxaApiMiniShopBusinessSupplyRefundRequest 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, "wxaapi", "minishop", "bussiSupplyRefund") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinMessageDeviceSubscribe/CgibinMessageDeviceSubscribeSendRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinMessageDeviceSubscribe/CgibinMessageDeviceSubscribeSendRequest.cs index e441f675..a3509c16 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinMessageDeviceSubscribe/CgibinMessageDeviceSubscribeSendRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinMessageDeviceSubscribe/CgibinMessageDeviceSubscribeSendRequest.cs @@ -24,8 +24,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// /// 获取或设置接收消息的用户 OpenId 列表。 /// - [Newtonsoft.Json.JsonProperty("touser")] - [System.Text.Json.Serialization.JsonPropertyName("touser")] + [Newtonsoft.Json.JsonProperty("to_openid_list")] + [System.Text.Json.Serialization.JsonPropertyName("to_openid_list")] public IList ToUserOpenIdList { get; set; } = new List(); /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintRequest.cs new file mode 100644 index 00000000..229dff55 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintRequest.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/minishop/bussiRespondComplaint 接口的请求。 + /// + public class WxaApiMiniShopBusinessRespondComplaintRequest : WechatApiRequest + { + /// + /// 获取或设置投诉单号。 + /// + [Newtonsoft.Json.JsonProperty("complaintOrderId")] + [System.Text.Json.Serialization.JsonPropertyName("complaintOrderId")] + public long ComplaintOrderId { get; set; } + + /// + /// 获取或设置内容。 + /// + [Newtonsoft.Json.JsonProperty("content")] + [System.Text.Json.Serialization.JsonPropertyName("content")] + public string? Content { get; set; } + + /// + /// 获取或设置图片 MediaId 列表。 + /// + [Newtonsoft.Json.JsonProperty("mediaIdList")] + [System.Text.Json.Serialization.JsonPropertyName("mediaIdList")] + public IList? MediaIdList { get; set; } + + /// + /// 获取或设置和解类型。 + /// + [Newtonsoft.Json.JsonProperty("bussiHandle")] + [System.Text.Json.Serialization.JsonPropertyName("bussiHandle")] + public int HandleType { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintResponse.cs new file mode 100644 index 00000000..53dae7e2 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/minishop/bussiRespondComplaint 接口的响应。 + /// + public class WxaApiMiniShopBusinessRespondComplaintResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofRequest.cs new file mode 100644 index 00000000..6f70294f --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofRequest.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/minishop/bussiSupplyProof 接口的请求。 + /// + public class WxaApiMiniShopBusinessSupplyProofRequest : WechatApiRequest + { + /// + /// 获取或设置投诉单号。 + /// + [Newtonsoft.Json.JsonProperty("complaintOrderId")] + [System.Text.Json.Serialization.JsonPropertyName("complaintOrderId")] + public long ComplaintOrderId { get; set; } + + /// + /// 获取或设置内容。 + /// + [Newtonsoft.Json.JsonProperty("content")] + [System.Text.Json.Serialization.JsonPropertyName("content")] + public string? Content { get; set; } + + /// + /// 获取或设置图片 MediaId 列表。 + /// + [Newtonsoft.Json.JsonProperty("mediaIdList")] + [System.Text.Json.Serialization.JsonPropertyName("mediaIdList")] + public IList? MediaIdList { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofResponse.cs new file mode 100644 index 00000000..17dc542e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/minishop/bussiSupplyProof 接口的响应。 + /// + public class WxaApiMiniShopBusinessSupplyProofResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyRefundRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyRefundRequest.cs new file mode 100644 index 00000000..0f31c854 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyRefundRequest.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/minishop/bussiSupplyRefund 接口的请求。 + /// + public class WxaApiMiniShopBusinessSupplyRefundRequest : WxaApiMiniShopBusinessSupplyProofRequest + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyRefundResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyRefundResponse.cs new file mode 100644 index 00000000..52e15af2 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyRefundResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxaapi/minishop/bussiSupplyRefund 接口的响应。 + /// + public class WxaApiMiniShopBusinessSupplyRefundResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailRequest.cs new file mode 100644 index 00000000..b504bc88 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxaapi/minishop/complaintOrderDetail 接口的请求。 + /// + public class WxaApiMiniShopComplaintOrderDetailRequest : WechatApiRequest + { + /// + /// 获取或设置投诉单号。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public long ComplaintOrderId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailResponse.cs new file mode 100644 index 00000000..b55269d7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailResponse.cs @@ -0,0 +1,211 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxaapi/minishop/complaintOrderDetail 接口的响应。 + /// + public class WxaApiMiniShopComplaintOrderDetailResponse : WechatApiResponse + { + public static class Types + { + public class ComplaintOrder + { + public static class Types + { + public class CustomerMaterial + { + /// + /// 获取或设置内容。 + /// + [Newtonsoft.Json.JsonProperty("content")] + [System.Text.Json.Serialization.JsonPropertyName("content")] + public string? Content { get; set; } + + /// + /// 获取或设置图片 MediaId 列表。 + /// + [Newtonsoft.Json.JsonProperty("mediaIdList")] + [System.Text.Json.Serialization.JsonPropertyName("mediaIdList")] + public string[]? MediaIdList { get; set; } + } + } + + /// + /// 获取或设置投诉单号。 + /// + [Newtonsoft.Json.JsonProperty("complaintOrderId")] + [System.Text.Json.Serialization.JsonPropertyName("complaintOrderId")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long ComplaintOrderId { get; set; } + + /// + /// 获取或设置用户 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("openId")] + [System.Text.Json.Serialization.JsonPropertyName("openId")] + public string OpenId { get; set; } = default!; + + /// + /// 获取或设置投诉问题类型。 + /// + [Newtonsoft.Json.JsonProperty("type")] + [System.Text.Json.Serialization.JsonPropertyName("type")] + public int Type { get; set; } + + /// + /// 获取或设置订单状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public int Status { get; set; } + + /// + /// 获取或设置用户手机号码。 + /// + [Newtonsoft.Json.JsonProperty("phoneNumber")] + [System.Text.Json.Serialization.JsonPropertyName("phoneNumber")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringConverter))] + public string PhoneNumber { get; set; } = default!; + + /// + /// 获取或设置投诉材料信息。 + /// + [Newtonsoft.Json.JsonProperty("customerMaterial")] + [System.Text.Json.Serialization.JsonPropertyName("customerMaterial")] + public Types.CustomerMaterial? CustomerMaterial { get; set; } = default!; + + /// + /// 获取或设置订单号。 + /// + [Newtonsoft.Json.JsonProperty("orderId")] + [System.Text.Json.Serialization.JsonPropertyName("orderId")] + public string OrderId { get; set; } = default!; + + /// + /// 获取或设置商户订单号。 + /// + [Newtonsoft.Json.JsonProperty("outTradeNo")] + [System.Text.Json.Serialization.JsonPropertyName("outTradeNo")] + public string OutTradeNumber { get; set; } = default!; + + /// + /// 获取或设置商品名称。 + /// + [Newtonsoft.Json.JsonProperty("productName")] + [System.Text.Json.Serialization.JsonPropertyName("productName")] + public string ProductName { get; set; } = default!; + + /// + /// 获取或设置支付时间戳。 + /// + [Newtonsoft.Json.JsonProperty("payTime")] + [System.Text.Json.Serialization.JsonPropertyName("payTime")] + public long PayTimestamp { get; set; } + + /// + /// 获取或设置交易金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("totalCost")] + [System.Text.Json.Serialization.JsonPropertyName("totalCost")] + public int TotalCost { get; set; } + + /// + /// 获取或设置投诉发起时间戳。 + /// + [Newtonsoft.Json.JsonProperty("createTime")] + [System.Text.Json.Serialization.JsonPropertyName("createTime")] + public long CreateTimestamp { get; set; } + + /// + /// 获取或设置投诉状态过期时间戳。 + /// + [Newtonsoft.Json.JsonProperty("expireTime")] + [System.Text.Json.Serialization.JsonPropertyName("expireTime")] + public long ExpireTimestamp { get; set; } + } + + public class ComplaintHistory + { + /// + /// 获取或设置投诉节点状态。 + /// + [Newtonsoft.Json.JsonProperty("itemType")] + [System.Text.Json.Serialization.JsonPropertyName("itemType")] + public int ItemType { get; set; } + + /// + /// 获取或设置时间戳。 + /// + [Newtonsoft.Json.JsonProperty("time")] + [System.Text.Json.Serialization.JsonPropertyName("time")] + public long Timestamp { get; set; } + + /// + /// 获取或设置手机号码。 + /// + [Newtonsoft.Json.JsonProperty("phoneNumber")] + [System.Text.Json.Serialization.JsonPropertyName("phoneNumber")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringConverter))] + public string? PhoneNumber { get; set; } + + /// + /// 获取或设置内容。 + /// + [Newtonsoft.Json.JsonProperty("content")] + [System.Text.Json.Serialization.JsonPropertyName("content")] + public string? Content { get; set; } + + /// + /// 获取或设置图片 MediaId 列表。 + /// + [Newtonsoft.Json.JsonProperty("mediaIdList")] + [System.Text.Json.Serialization.JsonPropertyName("mediaIdList")] + public string[]? MediaIdList { get; set; } + } + + public class ReturnBill + { + /// + /// 获取或设置退货单 ID。 + /// + [Newtonsoft.Json.JsonProperty("returnId")] + [System.Text.Json.Serialization.JsonPropertyName("returnId")] + public string ReturnId { get; set; } = default!; + + /// + /// 获取或设置运单号。 + /// + [Newtonsoft.Json.JsonProperty("waybillId")] + [System.Text.Json.Serialization.JsonPropertyName("waybillId")] + public string WaybillId { get; set; } = default!; + + /// + /// 获取或设置运单状态。 + /// + [Newtonsoft.Json.JsonProperty("orderStatus")] + [System.Text.Json.Serialization.JsonPropertyName("orderStatus")] + public int Status { get; set; } + } + } + + /// + /// 获取或设置投诉单信息。 + /// + [Newtonsoft.Json.JsonProperty("complaintOrder")] + [System.Text.Json.Serialization.JsonPropertyName("complaintOrder")] + public Types.ComplaintOrder ComplaintOrder { get; set; } = default!; + + /// + /// 获取或设置投诉进度列表。 + /// + [Newtonsoft.Json.JsonProperty("item")] + [System.Text.Json.Serialization.JsonPropertyName("item")] + public Types.ComplaintHistory[] ComplaintHistoryList { get; set; } = default!; + + /// + /// 获取或设置退货单信息。 + /// + [Newtonsoft.Json.JsonProperty("returnBill")] + [System.Text.Json.Serialization.JsonPropertyName("returnBill")] + public Types.ReturnBill? ReturnBill { get; set; } + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/WxaMiniShop/ComplaintCallbackEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/WxaMiniShop/ComplaintCallbackEvent.xml new file mode 100644 index 00000000..1093cdfa --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/WxaMiniShop/ComplaintCallbackEvent.xml @@ -0,0 +1,30 @@ + + 123 + + +​ 123 +​ 123 +​ 123 +​ 123 +​ 123 +​ 123 +​ 123 + 123 +​ 123 +​ 123 +​ 123 +​ 123 +​ 123 +​ 123 +​ 123 +​ +​ +​ 123 +​ 123 + +​ +​ +​ 123 +​ 123 + + \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/CgibinMessageDeviceSubscribe/CgibinMessageDeviceSubscribeSendRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/CgibinMessageDeviceSubscribe/CgibinMessageDeviceSubscribeSendRequest.json index 8bfd6eff..73239096 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/CgibinMessageDeviceSubscribe/CgibinMessageDeviceSubscribeSendRequest.json +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/CgibinMessageDeviceSubscribe/CgibinMessageDeviceSubscribeSendRequest.json @@ -1,19 +1,13 @@ { - "touser": "OPENID", + "to_openid_list": [ "OPENID_1", "OPENID_2" ], + "sn": "XXXXXXX", "template_id": "TEMPLATE_ID", "page": "index", + "miniprogram_state": "formal", + "lang": "zh_CN", "data": { - "name01": { - "value": "某某" - }, - "amount01": { - "value": "¥100" - }, - "thing01": { - "value": "广州至北京" - }, - "date01": { - "value": "2018-01-01" + "time1": { + "value": "2021-09-10 19:00:00" } } } \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/CgibinMessageTemplateSubscribe/CgibinMessageTemplateSubscribeRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/CgibinMessageTemplateSubscribe/CgibinMessageTemplateSubscribeRequest.json index ca7a59b3..61daecac 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/CgibinMessageTemplateSubscribe/CgibinMessageTemplateSubscribeRequest.json +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/CgibinMessageTemplateSubscribe/CgibinMessageTemplateSubscribeRequest.json @@ -2,10 +2,6 @@ "touser": "OPENID", "template_id": "TEMPLATE_ID", "url": "URL", - "miniprogram": { - "appid": "xiaochengxuappid12345", - "pagepath": "index?foo=bar" - }, "scene": "SCENE", "title": "TITLE", "data": { diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintRequest.json new file mode 100644 index 00000000..2969443e --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintRequest.json @@ -0,0 +1,6 @@ +{ + "content": "", + "complaintOrderId": 1212, + "mediaIdList": [], + "bussiHandle": 1 +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintResponse.json new file mode 100644 index 00000000..27dc7b40 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessRespondComplaintResponse.json @@ -0,0 +1,3 @@ +{ + "errcode": 0 +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofRequest.json new file mode 100644 index 00000000..c487d6b4 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofRequest.json @@ -0,0 +1,5 @@ +{ + "content": "", + "complaintOrderId": 1212, + "mediaIdList": [] +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofResponse.json new file mode 100644 index 00000000..680d59aa --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopBusinessSupplyProofResponse.json @@ -0,0 +1,3 @@ +{ + "errcode": 0 +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailRequest.json new file mode 100644 index 00000000..22fdca1b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailRequest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailResponse.json new file mode 100644 index 00000000..4eb376bf --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/WxaApi/MiniShop/WxaApiMiniShopComplaintOrderDetailResponse.json @@ -0,0 +1,36 @@ +{ + "errcode": 0, + "errmsg": "ok", + "complaintOrder": { + "complaintOrderId": 1212, + "openId": "dfasefasefase", + "createTime": 123124124, + "phoneNumber": 156222222, + "type": 12, + "status": 1, + "customerMaterial": { + "content": "", + "mediaIdList": [ "fsadfasdfsaf" ] + }, + "orderId": "2342", + "outTradeNo": "sdfsfd", + "productName": "sdf", + "payTime": 123123, + "totalCost": 1213, + "expireTime": 1231231 + }, + "item": [ + { + "itemType": 1, + "time": 1233234234, + "phoneNumber": "156222222", + "content": "", + "mediaIdList": [ "asdfasdf" ] + } + ], + "returnBill": { + "returnId": "23234234234", + "waybillId": "adfasdf", + "orderStatus": 4 + } +} \ No newline at end of file