diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/POI/CreateMapPOIAuditInfoEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/POI/CreateMapPOIAuditInfoEvent.cs new file mode 100644 index 00000000..fb9ee44d --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/POI/CreateMapPOIAuditInfoEvent.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.create_map_poi_audit_info 事件的数据。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#11 + /// + public class CreateMapPOIAuditInfoEvent : WechatApiEvent, WechatApiEvent.Types.IJsonSerializable, WechatApiEvent.Types.IXmlSerializable + { + /// + /// 获取或设置审核单 ID。 + /// + [Newtonsoft.Json.JsonProperty("audit_id")] + [System.Text.Json.Serialization.JsonPropertyName("audit_id")] + [System.Xml.Serialization.XmlElement("audit_id")] + public int AuditId { get; set; } + + /// + /// 获取或设置审核状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + [System.Xml.Serialization.XmlElement("status")] + public int AuditStatus { get; set; } + + /// + /// 获取或设置腾讯地图的位置点 ID。 + /// + [Newtonsoft.Json.JsonProperty("map_poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("map_poi_id")] + [System.Xml.Serialization.XmlElement("map_poi_id")] + public string MapPOIId { get; set; } = default!; + + /// + /// 获取或设置门店名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + [System.Xml.Serialization.XmlElement("name")] + public string Name { get; set; } = default!; + + /// + /// 获取或设置门店详细地址。 + /// + [Newtonsoft.Json.JsonProperty("address")] + [System.Text.Json.Serialization.JsonPropertyName("address")] + [System.Xml.Serialization.XmlElement("address")] + public string Address { get; set; } = default!; + + /// + /// 获取或设置门店位置经度。 + /// + [Newtonsoft.Json.JsonProperty("longitude")] + [System.Text.Json.Serialization.JsonPropertyName("longitude")] + [System.Xml.Serialization.XmlElement("longitude")] + public double Longitude { get; set; } + + /// + /// 获取或设置门店位置纬度。 + /// + [Newtonsoft.Json.JsonProperty("latitude")] + [System.Text.Json.Serialization.JsonPropertyName("latitude")] + [System.Xml.Serialization.XmlElement("latitude")] + public double Latitude { get; set; } + + /// + /// 获取或设置备注。 + /// + [Newtonsoft.Json.JsonProperty("sh_remark")] + [System.Text.Json.Serialization.JsonPropertyName("sh_remark")] + [System.Xml.Serialization.XmlElement("sh_remark")] + public string Remark { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCardExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCardExtensions.cs index 7551fa0b..b54f0d52 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCardExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCardExtensions.cs @@ -1093,5 +1093,49 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); } #endregion + + #region WxaStore + /// + /// 异步调用 [POST] /card/storewxa/get 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#18 + /// + /// + /// + /// + /// + public static async Task ExecuteCardStoreWxaGetAsync(this WechatApiClient client, Models.CardStoreWxaGetRequest 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(HttpMethod.Post, "card", "storewxa", "get") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /card/storewxa/set 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#18 + /// + /// + /// + /// + /// + public static async Task ExecuteCardStoreWxaSetAsync(this WechatApiClient client, Models.CardStoreWxaSetRequest 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(HttpMethod.Post, "card", "storewxa", "set") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinPOIExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinPOIExtensions.cs index 955b1202..9c056658 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinPOIExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinPOIExtensions.cs @@ -56,6 +56,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api /// /// 异步调用 [POST] /cgi-bin/poi/getpoilist 接口。 /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Store_Interface.html#10 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#17 /// /// /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaExtensions.cs index c3c28507..d54374f5 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteWxaExtensions.cs @@ -848,5 +848,259 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); } #endregion + + #region WxaStore + /// + /// 异步调用 [GET] /wxa/get_merchant_category 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#5 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaGetMerchantCategoryAsync(this WechatApiClient client, Models.WxaGetMerchantCategoryRequest 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(HttpMethod.Get, "wxa", "get_merchant_category") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestAsync(flurlReq, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxa/apply_merchant 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#6 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaApplyMerchantAsync(this WechatApiClient client, Models.WxaApplyMerchantRequest 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(HttpMethod.Post, "wxa", "apply_merchant") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [GET] /wxa/get_merchant_audit_info 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#7 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaGetMerchantAuditInfoAsync(this WechatApiClient client, Models.WxaGetMerchantAuditInfoRequest 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(HttpMethod.Get, "wxa", "get_merchant_audit_info") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestAsync(flurlReq, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxa/modify_merchant 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#8 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaModifyMerchantAsync(this WechatApiClient client, Models.WxaModifyMerchantRequest 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(HttpMethod.Post, "wxa", "modify_merchant") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [GET] /wxa/get_district 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#9 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaGetDistrictAsync(this WechatApiClient client, Models.WxaGetDistrictRequest 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(HttpMethod.Get, "wxa", "get_district") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestAsync(flurlReq, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxa/search_map_poi 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#10 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaSearchMapPOIAsync(this WechatApiClient client, Models.WxaSearchMapPOIRequest 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(HttpMethod.Post, "wxa", "search_map_poi") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxa/create_map_poi 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#11 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaCreateMapPOIAsync(this WechatApiClient client, Models.WxaCreateMapPOIRequest 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(HttpMethod.Post, "wxa", "create_map_poi") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxa/add_store 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#12 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaAddStoreAsync(this WechatApiClient client, Models.WxaAddStoreRequest 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(HttpMethod.Post, "wxa", "add_store") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxa/update_store 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#13 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaUpdateStoreAsync(this WechatApiClient client, Models.WxaUpdateStoreRequest 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(HttpMethod.Post, "wxa", "update_store") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxa/get_store_info 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#14 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaGetStoreInfoAsync(this WechatApiClient client, Models.WxaGetStoreInfoRequest 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(HttpMethod.Post, "wxa", "get_store_info") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxa/get_store_list 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#15 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaGetStoreListAsync(this WechatApiClient client, Models.WxaGetStoreListRequest 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(HttpMethod.Post, "wxa", "get_store_list") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /wxa/del_store 接口。 + /// REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#16 + /// + /// + /// + /// + /// + public static async Task ExecuteWxaDeleteStoreAsync(this WechatApiClient client, Models.WxaDeleteStoreRequest 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(HttpMethod.Post, "wxa", "del_store") + .SetOptions(request) + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaGetRequest.cs new file mode 100644 index 00000000..dc476392 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaGetRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /card/storewxa/get 接口的请求。 + /// + public class CardStoreWxaGetRequest : WechatApiRequest + { + /// + /// 获取或设置门店 ID。 + /// + [Newtonsoft.Json.JsonProperty("poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("poi_id")] + public string POIId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaGetResponse.cs new file mode 100644 index 00000000..5f474306 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaGetResponse.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /card/storewxa/get 接口的响应。 + /// + public class CardStoreWxaGetResponse : WechatApiResponse + { + /// + /// 获取或设置卡券 ID。 + /// + [Newtonsoft.Json.JsonProperty("card_id")] + [System.Text.Json.Serialization.JsonPropertyName("card_id")] + public string? CardId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaSetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaSetRequest.cs new file mode 100644 index 00000000..88deacb7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaSetRequest.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /card/storewxa/set 接口的请求。 + /// + public class CardStoreWxaSetRequest : WechatApiRequest + { + /// + /// 获取或设置门店 ID。 + /// + [Newtonsoft.Json.JsonProperty("poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("poi_id")] + public string POIId { get; set; } = string.Empty; + + /// + /// 获取或设置卡券 ID。 + /// + [Newtonsoft.Json.JsonProperty("card_id")] + [System.Text.Json.Serialization.JsonPropertyName("card_id")] + public string CardId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaSetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaSetResponse.cs new file mode 100644 index 00000000..6a6ad614 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Card/WxaStore/CardStoreWxaSetResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /card/storewxa/set 接口的响应。 + /// + public class CardStoreWxaSetResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIAddPOIRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIAddPOIRequest.cs index 57112444..bd17b5b3 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIAddPOIRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIAddPOIRequest.cs @@ -10,7 +10,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models { public static class Types { - public class Business + public class POI { public static class Types { @@ -145,7 +145,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// 获取或设置营业时间。 /// [Newtonsoft.Json.JsonProperty("open_time")] - [System.Text.Json.Serialization.JsonPropertyName("intopen_timeroduction")] + [System.Text.Json.Serialization.JsonPropertyName("open_time")] public string? OpenTime { get; set; } /// @@ -171,6 +171,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("business")] [System.Text.Json.Serialization.JsonPropertyName("business")] - public Types.Business Business { get; set; } = new Types.Business(); + public Types.POI POI { get; set; } = new Types.POI(); } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIGetPOIListResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIGetPOIListResponse.cs index 74310db6..cc0e9ec6 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIGetPOIListResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIGetPOIListResponse.cs @@ -10,19 +10,40 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models { public static class Types { - public class Business + public class POI { public static class Types { - public class Base : CgibinPOIGetPOIResponse.Types.Business.Types.Base + public class Base : CgibinPOIGetPOIResponse.Types.POI.Types.Base { /// - /// 获取或设置商户门店 ID。 + /// 获取或设置门店 ID。 /// [Newtonsoft.Json.JsonProperty("poi_id")] [System.Text.Json.Serialization.JsonPropertyName("poi_id")] [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumberTypedStringConverter))] - public string? POIId { get; set; } + public string POIId { get; set; } = default!; + + /// + /// 获取或设置腾讯地图的位置点 ID。 + /// + [Newtonsoft.Json.JsonProperty("mapid")] + [System.Text.Json.Serialization.JsonPropertyName("mapid")] + public string? MapPOIId { get; set; } + + /// + /// 获取或设置迁移状态。 + /// + [Newtonsoft.Json.JsonProperty("upgrade_status")] + [System.Text.Json.Serialization.JsonPropertyName("upgrade_status")] + public int? UpgradeStatus { get; set; } + + /// + /// 获取或设置迁移驳回的理由。 + /// + [Newtonsoft.Json.JsonProperty("upgrade_comment")] + [System.Text.Json.Serialization.JsonPropertyName("upgrade_comment")] + public string? UpgradeRejectReason { get; set; } } } @@ -40,7 +61,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("business_list")] [System.Text.Json.Serialization.JsonPropertyName("business_list")] - public Types.Business[] BusinessList { get; set; } = default!; + public Types.POI[] POIList { get; set; } = default!; /// /// 获取或设置门店总数量。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIGetPOIResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIGetPOIResponse.cs index 3356cedf..e719ad83 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIGetPOIResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIGetPOIResponse.cs @@ -10,7 +10,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models { public static class Types { - public class Business + public class POI { public static class Types { @@ -145,7 +145,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// 获取或设置营业时间。 /// [Newtonsoft.Json.JsonProperty("open_time")] - [System.Text.Json.Serialization.JsonPropertyName("intopen_timeroduction")] + [System.Text.Json.Serialization.JsonPropertyName("open_time")] public string? OpenTime { get; set; } /// @@ -185,6 +185,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("business")] [System.Text.Json.Serialization.JsonPropertyName("business")] - public Types.Business Business { get; set; } = default!; + public Types.POI POI { get; set; } = default!; } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIUpdatePOIRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIUpdatePOIRequest.cs index 146f4eae..d77e0b63 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIUpdatePOIRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinPOI/CgibinPOIUpdatePOIRequest.cs @@ -18,7 +18,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models { public static class Types { - public class Photo : CgibinPOIAddPOIRequest.Types.Business.Types.Base.Types.Photo + public class Photo : CgibinPOIAddPOIRequest.Types.POI.Types.Base.Types.Photo { } } @@ -76,7 +76,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// 获取或设置营业时间。 /// [Newtonsoft.Json.JsonProperty("open_time")] - [System.Text.Json.Serialization.JsonPropertyName("intopen_timeroduction")] + [System.Text.Json.Serialization.JsonPropertyName("open_time")] public string? OpenTime { get; set; } /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinWxopen/Category/CgibinWxopenGetAllCategoriesResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinWxopen/Category/CgibinWxopenGetAllCategoriesResponse.cs index 29d06814..21ede001 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinWxopen/Category/CgibinWxopenGetAllCategoriesResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinWxopen/Category/CgibinWxopenGetAllCategoriesResponse.cs @@ -46,7 +46,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("url")] [System.Text.Json.Serialization.JsonPropertyName("url")] - public string ExampleUrl { get; set; } = default!; + public string? ExampleUrl { get; set; } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/NearybyPOI/WxaAddNearbyPOIRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/NearybyPOI/WxaAddNearbyPOIRequest.cs index 47218dd7..27e44a72 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/NearybyPOI/WxaAddNearbyPOIRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/NearybyPOI/WxaAddNearbyPOIRequest.cs @@ -310,6 +310,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models } } + /// + /// 获取或设置附近地点 ID。 + /// + [Newtonsoft.Json.JsonProperty("poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("poi_id")] + public string POIId { get; set; } = string.Empty; + /// /// (使用默认值即可,无需修改) /// @@ -319,6 +326,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumberTypedBooleanConverter))] public bool IsCommonNearby { get; set; } = true; + /// + /// 获取或设置腾讯地图的位置点 ID。 + /// + [Newtonsoft.Json.JsonProperty("map_poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("map_poi_id")] + public string? MapPOIId { get; set; } + /// /// 获取或设置门店图片信息。 /// @@ -351,7 +365,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("store_name")] [System.Text.Json.Serialization.JsonPropertyName("store_name")] - public string StoreName { get; set; } = string.Empty; + public string Name { get; set; } = string.Empty; /// /// 获取或设置营业时间(格式:HHmm-HHmm)。 @@ -365,14 +379,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("address")] [System.Text.Json.Serialization.JsonPropertyName("address")] - public string Addres { get; set; } = string.Empty; - - /// - /// 获取或设置附近地点 ID。 - /// - [Newtonsoft.Json.JsonProperty("poi_id")] - [System.Text.Json.Serialization.JsonPropertyName("poi_id")] - public string POIId { get; set; } = string.Empty; + public string Address { get; set; } = string.Empty; /// /// 获取或设置主体名称。 @@ -386,27 +393,20 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("contract_phone")] [System.Text.Json.Serialization.JsonPropertyName("contract_phone")] - public string ContractPhone { get; set; } = string.Empty; + public string TeleNumber { get; set; } = string.Empty; /// /// 获取或设置经营资质证件号。 /// [Newtonsoft.Json.JsonProperty("credential")] [System.Text.Json.Serialization.JsonPropertyName("credential")] - public string Credential { get; set; } = string.Empty; + public string LicenseNumber { get; set; } = string.Empty; /// - /// 获取或设置证明材料媒体文件标识。 + /// 获取或设置证明材料媒体文件标识列表。 /// [Newtonsoft.Json.JsonProperty("qualification_list")] [System.Text.Json.Serialization.JsonPropertyName("qualification_list")] - public string? QualificationMediaId { get; set; } - - /// - /// 获取或设置对应《在腾讯地图中搜索门店》中的 `sosomap_poi_uid` 字段。 - /// - [Newtonsoft.Json.JsonProperty("map_poi_id")] - [System.Text.Json.Serialization.JsonPropertyName("map_poi_id")] - public string? MapPOIId { get; set; } + public IList? QualificationMediaIdList { get; set; } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaAddStoreRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaAddStoreRequest.cs new file mode 100644 index 00000000..3ffc6ab7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaAddStoreRequest.cs @@ -0,0 +1,167 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/add_store 接口的请求。 + /// + public class WxaAddStoreRequest : WechatApiRequest + { + public static class Types + { + public class Picture + { + /// + /// 获取或设置门店图片 URL 列表。 + /// + [Newtonsoft.Json.JsonProperty("list")] + [System.Text.Json.Serialization.JsonPropertyName("list")] + public IList PictureUrlList { get; set; } = new List(); + } + } + + internal static class Converters + { + internal class NewtonsoftJsonPictureConverter : Newtonsoft.Json.JsonConverter + { + public override bool CanRead + { + get { return true; } + } + + public override bool CanWrite + { + get { return true; } + } + + public override Types.Picture? ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, Types.Picture? existingValue, bool hasExistingValue, Newtonsoft.Json.JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return existingValue; + } + else if (reader.TokenType == Newtonsoft.Json.JsonToken.String) + { + string? value = serializer.Deserialize(reader); + if (value == null) + return existingValue; + + return Newtonsoft.Json.JsonConvert.DeserializeObject(value); + } + + throw new Newtonsoft.Json.JsonReaderException(); + } + + public override void WriteJson(Newtonsoft.Json.JsonWriter writer, Types.Picture? value, Newtonsoft.Json.JsonSerializer serializer) + { + if (value != null) + writer.WriteValue(Newtonsoft.Json.JsonConvert.SerializeObject(value, Newtonsoft.Json.Formatting.None)); + else + writer.WriteNull(); + } + } + + internal class SystemTextJsonPictureConverter : System.Text.Json.Serialization.JsonConverter + { + public override Types.Picture? Read(ref System.Text.Json.Utf8JsonReader reader, Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType == System.Text.Json.JsonTokenType.Null) + { + return null; + } + else if (reader.TokenType == System.Text.Json.JsonTokenType.String) + { + string? value = reader.GetString(); + if (value == null) + return null; + + return System.Text.Json.JsonSerializer.Deserialize(value, options); + } + + throw new System.Text.Json.JsonException(); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Types.Picture? value, System.Text.Json.JsonSerializerOptions options) + { + if (value != null) + writer.WriteStringValue(System.Text.Json.JsonSerializer.Serialize(value, options)); + else + writer.WriteNullValue(); + } + } + } + + /// + /// 获取或设置原门店 ID。 + /// + [Newtonsoft.Json.JsonProperty("poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("poi_id")] + public string? POIId { get; set; } + + /// + /// 获取或设置腾讯地图的位置点 ID。 + /// + [Newtonsoft.Json.JsonProperty("map_poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("map_poi_id")] + public string MapPOIId { get; set; } = string.Empty; + + /// + /// 获取或设置门店图片信息。 + /// + [Newtonsoft.Json.JsonProperty("pic_list")] + [Newtonsoft.Json.JsonConverter(typeof(Converters.NewtonsoftJsonPictureConverter))] + [System.Text.Json.Serialization.JsonPropertyName("pic_list")] + [System.Text.Json.Serialization.JsonConverter(typeof(Converters.SystemTextJsonPictureConverter))] + public Types.Picture Picture { get; set; } = new Types.Picture(); + + /// + /// 获取或设置营业时间(格式:HHmm-HHmm)。 + /// + [Newtonsoft.Json.JsonProperty("hour")] + [System.Text.Json.Serialization.JsonPropertyName("hour")] + public string BusinessHours { get; set; } = string.Empty; + + /// + /// 获取或设置地址。 + /// + [Newtonsoft.Json.JsonProperty("address")] + [System.Text.Json.Serialization.JsonPropertyName("address")] + public string Address { get; set; } = string.Empty; + + /// + /// 获取或设置主体名称。 + /// + [Newtonsoft.Json.JsonProperty("company_name")] + [System.Text.Json.Serialization.JsonPropertyName("company_name")] + public string CompanyName { get; set; } = string.Empty; + + /// + /// 获取或设置门店电话。 + /// + [Newtonsoft.Json.JsonProperty("contract_phone")] + [System.Text.Json.Serialization.JsonPropertyName("contract_phone")] + public string Telephone { get; set; } = string.Empty; + + /// + /// 获取或设置经营资质证件号。 + /// + [Newtonsoft.Json.JsonProperty("credential")] + [System.Text.Json.Serialization.JsonPropertyName("credential")] + public string LicenseNumber { get; set; } = string.Empty; + + /// + /// 获取或设置证明材料媒体文件标识列表。 + /// + [Newtonsoft.Json.JsonProperty("qualification_list")] + [System.Text.Json.Serialization.JsonPropertyName("qualification_list")] + public IList? QualificationMediaIdList { get; set; } + + /// + /// 获取或设置卡券 ID。 + /// + [Newtonsoft.Json.JsonProperty("card_id")] + [System.Text.Json.Serialization.JsonPropertyName("card_id")] + public string CardId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaAddStoreResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaAddStoreResponse.cs new file mode 100644 index 00000000..9b98d4e9 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaAddStoreResponse.cs @@ -0,0 +1,28 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/add_store 接口的响应。 + /// + public class WxaAddStoreResponse : WechatApiResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置审核单 ID。 + /// + [Newtonsoft.Json.JsonProperty("audit_id")] + [System.Text.Json.Serialization.JsonPropertyName("audit_id")] + public int AuditId { get; set; } + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("data")] + [System.Text.Json.Serialization.JsonPropertyName("data")] + public Types.Data Data { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaApplyMerchantRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaApplyMerchantRequest.cs new file mode 100644 index 00000000..e436a5eb --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaApplyMerchantRequest.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/apply_merchant 接口的请求。 + /// + public class WxaApplyMerchantRequest : WechatApiRequest + { + /// + /// 获取或设置一级类目 ID。 + /// + [Newtonsoft.Json.JsonProperty("first_catid")] + [System.Text.Json.Serialization.JsonPropertyName("first_catid")] + public int FirstCategoryId { get; set; } + + /// + /// 获取或设置二级类目 ID。 + /// + [Newtonsoft.Json.JsonProperty("second_catid")] + [System.Text.Json.Serialization.JsonPropertyName("second_catid")] + public int SecondCategoryId { get; set; } + + /// + /// 获取或设置类目相关证件的媒体文件标识列表。 + /// + [Newtonsoft.Json.JsonProperty("qualification_list")] + [System.Text.Json.Serialization.JsonPropertyName("qualification_list")] + public IList? QualificationMediaIdList { get; set; } + + /// + /// 获取或设置门店小程序的昵称。 + /// + [Newtonsoft.Json.JsonProperty("nickname")] + [System.Text.Json.Serialization.JsonPropertyName("nickname")] + public string Nickname { get; set; } = string.Empty; + + /// + /// 获取或设置门店小程序的介绍。 + /// + [Newtonsoft.Json.JsonProperty("intro")] + [System.Text.Json.Serialization.JsonPropertyName("intro")] + public string Introduction { get; set; } = string.Empty; + + /// + /// 获取或设置门店小程序的头像媒体文件标识。 + /// + [Newtonsoft.Json.JsonProperty("headimg_mediaid")] + [System.Text.Json.Serialization.JsonPropertyName("headimg_mediaid")] + public string HeadImageMediaId { get; set; } = string.Empty; + + /// + /// 获取或设置营业执照图片媒体文件标识。 + /// + [Newtonsoft.Json.JsonProperty("org_code")] + [System.Text.Json.Serialization.JsonPropertyName("org_code")] + public string? LicenseMediaId { get; set; } + + /// + /// 获取或设置其他证明材料的媒体文件标识列表。 + /// + [Newtonsoft.Json.JsonProperty("other_files")] + [System.Text.Json.Serialization.JsonPropertyName("other_files")] + public IList? OtherFileMediaIdList { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaApplyMerchantResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaApplyMerchantResponse.cs new file mode 100644 index 00000000..0c0a9a4e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaApplyMerchantResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/apply_merchant 接口的响应。 + /// + public class WxaApplyMerchantResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaCreateMapPOIRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaCreateMapPOIRequest.cs new file mode 100644 index 00000000..eff90527 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaCreateMapPOIRequest.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/create_map_poi 接口的请求。 + /// + public class WxaCreateMapPOIRequest : WechatApiRequest + { + /// + /// 获取或设置原门店 ID。 + /// + [Newtonsoft.Json.JsonProperty("poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("poi_id")] + public string? POIId { get; set; } + + /// + /// 获取或设置门店名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + public string Name { get; set; } = string.Empty; + + /// + /// 获取或设置门店分类。 + /// + [Newtonsoft.Json.JsonProperty("category")] + [System.Text.Json.Serialization.JsonPropertyName("category")] + public string Category { get; set; } = string.Empty; + + /// + /// 获取或设置门店介绍。 + /// + [Newtonsoft.Json.JsonProperty("introduct")] + [System.Text.Json.Serialization.JsonPropertyName("introduct")] + public string Introduction { get; set; } = string.Empty; + + /// + /// 获取或设置门店电话。 + /// + [Newtonsoft.Json.JsonProperty("telephone")] + [System.Text.Json.Serialization.JsonPropertyName("telephone")] + public string Telephone { get; set; } = string.Empty; + + /// + /// 获取或设置门店位置经度。 + /// + [Newtonsoft.Json.JsonProperty("longitude")] + [System.Text.Json.Serialization.JsonPropertyName("longitude")] + public double Longitude { get; set; } + + /// + /// 获取或设置门店位置纬度。 + /// + [Newtonsoft.Json.JsonProperty("latitude")] + [System.Text.Json.Serialization.JsonPropertyName("latitude")] + public double Latitude { get; set; } + + /// + /// 获取或设置门店区域 ID。 + /// + [Newtonsoft.Json.JsonProperty("districtid")] + [System.Text.Json.Serialization.JsonPropertyName("districtid")] + public int DistrictId { get; set; } + + /// + /// 获取或设置门店所在省份。 + /// + [Newtonsoft.Json.JsonProperty("province")] + [System.Text.Json.Serialization.JsonPropertyName("province")] + public string Province { get; set; } = string.Empty; + + /// + /// 获取或设置门店所在城市。 + /// + [Newtonsoft.Json.JsonProperty("city")] + [System.Text.Json.Serialization.JsonPropertyName("city")] + public string City { get; set; } = string.Empty; + + /// + /// 获取或设置门店所在区县。 + /// + [Newtonsoft.Json.JsonProperty("district")] + [System.Text.Json.Serialization.JsonPropertyName("district")] + public string District { get; set; } = string.Empty; + + /// + /// 获取或设置门店详细地址。 + /// + [Newtonsoft.Json.JsonProperty("address")] + [System.Text.Json.Serialization.JsonPropertyName("address")] + public string Address { get; set; } = string.Empty; + + /// + /// 获取或设置门店图片媒体文件标识。 + /// + [Newtonsoft.Json.JsonProperty("photo")] + [System.Text.Json.Serialization.JsonPropertyName("photo")] + public string PictureMediaId { get; set; } = string.Empty; + + /// + /// 获取或设置营业执照图片媒体文件标识。 + /// + [Newtonsoft.Json.JsonProperty("license")] + [System.Text.Json.Serialization.JsonPropertyName("license")] + public string LicenseMediaId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaCreateMapPOIResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaCreateMapPOIResponse.cs new file mode 100644 index 00000000..9b7f8dc8 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaCreateMapPOIResponse.cs @@ -0,0 +1,28 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/create_map_poi 接口的响应。 + /// + public class WxaCreateMapPOIResponse : WechatApiResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置审核单 ID。 + /// + [Newtonsoft.Json.JsonProperty("base_id")] + [System.Text.Json.Serialization.JsonPropertyName("base_id")] + public int AuditId { get; set; } + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("data")] + [System.Text.Json.Serialization.JsonPropertyName("data")] + public Types.Data Data { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaDeleteStoreRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaDeleteStoreRequest.cs new file mode 100644 index 00000000..79efb4b7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaDeleteStoreRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/del_store 接口的请求。 + /// + public class WxaDeleteStoreRequest : WechatApiRequest + { + /// + /// 获取或设置门店 ID。 + /// + [Newtonsoft.Json.JsonProperty("poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("poi_id")] + public string POIId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaDeleteStoreResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaDeleteStoreResponse.cs new file mode 100644 index 00000000..c32b9ba6 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaDeleteStoreResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/del_store 接口的响应。 + /// + public class WxaDeleteStoreResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetDistrictRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetDistrictRequest.cs new file mode 100644 index 00000000..29b0b427 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetDistrictRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxa/get_district 接口的请求。 + /// + public class WxaGetDistrictRequest : WechatApiRequest + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetDistrictResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetDistrictResponse.cs new file mode 100644 index 00000000..480f16ee --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetDistrictResponse.cs @@ -0,0 +1,90 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxa/get_district 接口的响应。 + /// + public class WxaGetDistrictResponse : WechatApiResponse + { + public static class Types + { + public class District + { + public static class Types + { + public class Location + { + /// + /// 获取或设置经度。 + /// + [Newtonsoft.Json.JsonProperty("lng")] + [System.Text.Json.Serialization.JsonPropertyName("lng")] + public double Longitude { get; set; } + + /// + /// 获取或设置纬度。 + /// + [Newtonsoft.Json.JsonProperty("lat")] + [System.Text.Json.Serialization.JsonPropertyName("lat")] + public double Latitude { get; set; } + } + } + + /// + /// 获取或设置区域 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public int DistrictId { get; set; } + + /// + /// 获取或设置区域名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + public string Name { get; set; } = default!; + + /// + /// 获取或设置区域全称。 + /// + [Newtonsoft.Json.JsonProperty("fullname")] + [System.Text.Json.Serialization.JsonPropertyName("fullname")] + public string FullName { get; set; } = default!; + + /// + /// 获取或设置区域经纬度信息。 + /// + [Newtonsoft.Json.JsonProperty("location")] + [System.Text.Json.Serialization.JsonPropertyName("location")] + public Types.Location? Location { get; set; } + + /// + /// 获取或设置区域拼音。 + /// + [Newtonsoft.Json.JsonProperty("pinyin")] + [System.Text.Json.Serialization.JsonPropertyName("pinyin")] + public string[]? Pinyin { get; set; } + + /// + /// 获取或设置下属城市区域 ID 列表 + /// + [Newtonsoft.Json.JsonProperty("cidx")] + [System.Text.Json.Serialization.JsonPropertyName("cidx")] + public int[]? CityIdList { get; set; } + } + } + + /// + /// 获取或设置数据版本号。 + /// + [Newtonsoft.Json.JsonProperty("data_version")] + [System.Text.Json.Serialization.JsonPropertyName("data_version")] + public string DataVersion { get; set; } = default!; + + /// + /// 获取或设置区域列表。 + /// + [Newtonsoft.Json.JsonProperty("result")] + [System.Text.Json.Serialization.JsonPropertyName("result")] + public Types.District[][] DistrictList { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantAuditInfoRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantAuditInfoRequest.cs new file mode 100644 index 00000000..ca0c7a0e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantAuditInfoRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxa/get_merchant_audit_info 接口的请求。 + /// + public class WxaGetMerchantAuditInfoRequest : WechatApiRequest + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantAuditInfoResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantAuditInfoResponse.cs new file mode 100644 index 00000000..694f35d5 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantAuditInfoResponse.cs @@ -0,0 +1,42 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxa/get_merchant_audit_info 接口的响应。 + /// + public class WxaGetMerchantAuditInfoResponse : WechatApiResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置审核单 ID。 + /// + [Newtonsoft.Json.JsonProperty("audit_id")] + [System.Text.Json.Serialization.JsonPropertyName("audit_id")] + public int AuditId { get; set; } + + /// + /// 获取或设置审核状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public int AuditStatus { get; set; } + + /// + /// 获取或设置审核拒绝原因。 + /// + [Newtonsoft.Json.JsonProperty("reason")] + [System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? AuditRejectReason { get; set; } + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("data")] + [System.Text.Json.Serialization.JsonPropertyName("data")] + public Types.Data Data { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantCategoryRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantCategoryRequest.cs new file mode 100644 index 00000000..e9745d27 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantCategoryRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxa/get_merchant_category 接口的请求。 + /// + public class WxaGetMerchantCategoryRequest : WechatApiRequest + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantCategoryResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantCategoryResponse.cs new file mode 100644 index 00000000..590cc75c --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetMerchantCategoryResponse.cs @@ -0,0 +1,45 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /wxa/get_merchant_category 接口的响应。 + /// + public class WxaGetMerchantCategoryResponse : WechatApiResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class CategoryList + { + /// + /// 获取或设置分类列表。 + /// + [Newtonsoft.Json.JsonProperty("categories")] + [System.Text.Json.Serialization.JsonPropertyName("categories")] + public CategoryItem[] Items { get; set; } = default!; + } + + public class CategoryItem : CgibinWxopenGetAllCategoriesResponse.Types.CategoryItem + { + } + } + + /// + /// 获取或设置分类列表。 + /// + [Newtonsoft.Json.JsonProperty("all_category_info")] + [System.Text.Json.Serialization.JsonPropertyName("all_category_info")] + public Types.CategoryList CategoryList { get; set; } = default!; + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("data")] + [System.Text.Json.Serialization.JsonPropertyName("data")] + public Types.Data Data { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreInfoRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreInfoRequest.cs new file mode 100644 index 00000000..4ce52575 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreInfoRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/get_store_info 接口的请求。 + /// + public class WxaGetStoreInfoRequest : WechatApiRequest + { + /// + /// 获取或设置门店 ID。 + /// + [Newtonsoft.Json.JsonProperty("poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("poi_id")] + public string POIId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreInfoResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreInfoResponse.cs new file mode 100644 index 00000000..d6c123f4 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreInfoResponse.cs @@ -0,0 +1,131 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/get_store_info 接口的响应。 + /// + public class WxaGetStoreInfoResponse : WechatApiResponse + { + public static class Types + { + public class POI + { + public static class Types + { + public class Base + { + public static class Types + { + public class Picture + { + /// + /// 获取或设置图片 URL。 + /// + [Newtonsoft.Json.JsonProperty("photo_url")] + [System.Text.Json.Serialization.JsonPropertyName("photo_url")] + public string PictureUrl { get; set; } = default!; + } + } + + /// + /// 获取或设置门店 ID。 + /// + [Newtonsoft.Json.JsonProperty("poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("poi_id")] + public string POIId { get; set; } = default!; + + /// + /// 获取或设置门店名称。 + /// + [Newtonsoft.Json.JsonProperty("business_name")] + [System.Text.Json.Serialization.JsonPropertyName("business_name")] + public string BusinessName { get; set; } = default!; + + /// + /// 获取或设置省份。 + /// + [Newtonsoft.Json.JsonProperty("province")] + [System.Text.Json.Serialization.JsonPropertyName("province")] + public string Province { get; set; } = default!; + + /// + /// 获取或设置城市。 + /// + [Newtonsoft.Json.JsonProperty("city")] + [System.Text.Json.Serialization.JsonPropertyName("city")] + public string City { get; set; } = default!; + + /// + /// 获取或设置区县。 + /// + [Newtonsoft.Json.JsonProperty("district")] + [System.Text.Json.Serialization.JsonPropertyName("district")] + public string District { get; set; } = default!; + + /// + /// 获取或设置详细地址。 + /// + [Newtonsoft.Json.JsonProperty("address")] + [System.Text.Json.Serialization.JsonPropertyName("address")] + public string Address { get; set; } = default!; + + /// + /// 获取或设置联系电话。 + /// + [Newtonsoft.Json.JsonProperty("telephone")] + [System.Text.Json.Serialization.JsonPropertyName("telephone")] + public string Telephone { get; set; } = default!; + + /// + /// 获取或设置经度。 + /// + [Newtonsoft.Json.JsonProperty("longitude")] + [System.Text.Json.Serialization.JsonPropertyName("longitude")] + public double Longitude { get; set; } + + /// + /// 获取或设置纬度。 + /// + [Newtonsoft.Json.JsonProperty("latitude")] + [System.Text.Json.Serialization.JsonPropertyName("latitude")] + public double Latitude { get; set; } + + /// + /// 获取或设置营业时间(格式:HHmm-HHmm)。 + /// + [Newtonsoft.Json.JsonProperty("open_time")] + [System.Text.Json.Serialization.JsonPropertyName("open_time")] + public string BusinessHours { get; set; } = default!; + + /// + /// 获取或设置门店图片列表。 + /// + [Newtonsoft.Json.JsonProperty("photo_list")] + [System.Text.Json.Serialization.JsonPropertyName("photo_list")] + public Types.Picture[]? PictureList { get; set; } + + /// + /// 获取或设置审核状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public int Status { get; set; } + } + } + + /// + /// 获取或设置门店基本信息。 + /// + [Newtonsoft.Json.JsonProperty("base_info")] + [System.Text.Json.Serialization.JsonPropertyName("base_info")] + public Types.Base Base { get; set; } = default!; + } + } + + /// + /// 获取或设置门店信息。 + /// + [Newtonsoft.Json.JsonProperty("business")] + [System.Text.Json.Serialization.JsonPropertyName("business")] + public Types.POI POI { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreListRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreListRequest.cs new file mode 100644 index 00000000..46470c7b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreListRequest.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/get_store_list 接口的请求。 + /// + public class WxaGetStoreListRequest : WechatApiRequest + { + /// + /// 获取或设置分页起始位置。 + /// + [Newtonsoft.Json.JsonProperty("offset")] + [System.Text.Json.Serialization.JsonPropertyName("offset")] + public int Offset { get; set; } + + /// + /// 获取或设置分页每页数量。 + /// + [Newtonsoft.Json.JsonProperty("limit")] + [System.Text.Json.Serialization.JsonPropertyName("limit")] + public int Limit { get; set; } = 20; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreListResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreListResponse.cs new file mode 100644 index 00000000..e7b1ea0c --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaGetStoreListResponse.cs @@ -0,0 +1,42 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/get_store_list 接口的响应。 + /// + public class WxaGetStoreListResponse : WechatApiResponse + { + public static class Types + { + public class POI + { + public static class Types + { + public class Base : WxaGetStoreInfoResponse.Types.POI.Types.Base + { + } + } + + /// + /// 获取或设置门店基本信息。 + /// + [Newtonsoft.Json.JsonProperty("base_info")] + [System.Text.Json.Serialization.JsonPropertyName("base_info")] + public Types.Base Base { get; set; } = default!; + } + } + + /// + /// 获取或设置门店列表。 + /// + [Newtonsoft.Json.JsonProperty("business_list")] + [System.Text.Json.Serialization.JsonPropertyName("business_list")] + public Types.POI[] POIList { get; set; } = default!; + + /// + /// 获取或设置门店总数量。 + /// + [Newtonsoft.Json.JsonProperty("total_count")] + [System.Text.Json.Serialization.JsonPropertyName("total_count")] + public int Total { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaModifyMerchantRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaModifyMerchantRequest.cs new file mode 100644 index 00000000..30d1f31b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaModifyMerchantRequest.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/modify_merchant 接口的请求。 + /// + public class WxaModifyMerchantRequest : WechatApiRequest + { + /// + /// 获取或设置门店小程序的介绍。 + /// + [Newtonsoft.Json.JsonProperty("intro")] + [System.Text.Json.Serialization.JsonPropertyName("intro")] + public string Introduction { get; set; } = string.Empty; + + /// + /// 获取或设置门店小程序的头像媒体文件标识。 + /// + [Newtonsoft.Json.JsonProperty("headimg_mediaid")] + [System.Text.Json.Serialization.JsonPropertyName("headimg_mediaid")] + public string HeadImageMediaId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaModifyMerchantResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaModifyMerchantResponse.cs new file mode 100644 index 00000000..1d28e16b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaModifyMerchantResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/modify_merchant 接口的响应。 + /// + public class WxaModifyMerchantResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaSearchMapPOIRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaSearchMapPOIRequest.cs new file mode 100644 index 00000000..b1826f1b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaSearchMapPOIRequest.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/search_map_poi 接口的请求。 + /// + public class WxaSearchMapPOIRequest : WechatApiRequest + { + /// + /// 获取或设置区域 ID。 + /// + [Newtonsoft.Json.JsonProperty("districtid")] + [System.Text.Json.Serialization.JsonPropertyName("districtid")] + public int DistrictId { get; set; } + + /// + /// 获取或设置搜索的关键字。 + /// + [Newtonsoft.Json.JsonProperty("keyword")] + [System.Text.Json.Serialization.JsonPropertyName("keyword")] + public string Keyword { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaSearchMapPOIResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaSearchMapPOIResponse.cs new file mode 100644 index 00000000..919bb996 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaSearchMapPOIResponse.cs @@ -0,0 +1,97 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/search_map_poi 接口的响应。 + /// + public class WxaSearchMapPOIResponse : WechatApiResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class POI + { + /// + /// 获取或设置腾讯地图的位置点 ID。 + /// + [Newtonsoft.Json.JsonProperty("sosomap_poi_uid")] + [System.Text.Json.Serialization.JsonPropertyName("sosomap_poi_uid")] + public string MapPOIId { get; set; } = default!; + + /// + /// 获取或设置分店名称。 + /// + [Newtonsoft.Json.JsonProperty("branch_name")] + [System.Text.Json.Serialization.JsonPropertyName("branch_name")] + public string BranchName { get; set; } = default!; + + /// + /// 获取或设置门店分类。 + /// + [Newtonsoft.Json.JsonProperty("category")] + [System.Text.Json.Serialization.JsonPropertyName("category")] + public string Category { get; set; } = default!; + + /// + /// 获取或设置门店详细地址。 + /// + [Newtonsoft.Json.JsonProperty("address")] + [System.Text.Json.Serialization.JsonPropertyName("address")] + public string Address { get; set; } = default!; + + /// + /// 获取或设置门店电话。 + /// + [Newtonsoft.Json.JsonProperty("telephone")] + [System.Text.Json.Serialization.JsonPropertyName("telephone")] + public string Telephone { get; set; } = default!; + + /// + /// 获取或设置门店位置经度。 + /// + [Newtonsoft.Json.JsonProperty("longitude")] + [System.Text.Json.Serialization.JsonPropertyName("longitude")] + public double Longitude { get; set; } + + /// + /// 获取或设置门店位置纬度。 + /// + [Newtonsoft.Json.JsonProperty("latitude")] + [System.Text.Json.Serialization.JsonPropertyName("latitude")] + public double Latitude { get; set; } + + /// + /// 获取或设置门店图片 URL 列表。 + /// + [Newtonsoft.Json.JsonProperty("pic_urls")] + [System.Text.Json.Serialization.JsonPropertyName("pic_urls")] + public string[]? PictureUrlList { get; set; } + + /// + /// 获取或设置卡券 ID 列表。 + /// + [Newtonsoft.Json.JsonProperty("card_id_list")] + [System.Text.Json.Serialization.JsonPropertyName("card_id_list")] + public string[]? CardIdList { get; set; } + } + } + + /// + /// 获取或设置门店列表。 + /// + [Newtonsoft.Json.JsonProperty("item")] + [System.Text.Json.Serialization.JsonPropertyName("item")] + public Types.POI[] POIList { get; set; } = default!; + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("data")] + [System.Text.Json.Serialization.JsonPropertyName("data")] + public Types.Data Data { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaUpdateStoreRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaUpdateStoreRequest.cs new file mode 100644 index 00000000..e8667c99 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaUpdateStoreRequest.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/update_store 接口的请求。 + /// + public class WxaUpdateStoreRequest : WechatApiRequest + { + public static class Types + { + public class Picture : WxaAddStoreRequest.Types.Picture + { + } + } + + internal static class Converters + { + internal class NewtonsoftJsonPictureConverter : Newtonsoft.Json.JsonConverter + { + public override bool CanRead + { + get { return true; } + } + + public override bool CanWrite + { + get { return true; } + } + + public override Types.Picture? ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, Types.Picture? existingValue, bool hasExistingValue, Newtonsoft.Json.JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return existingValue; + } + else if (reader.TokenType == Newtonsoft.Json.JsonToken.String) + { + string? value = serializer.Deserialize(reader); + if (value == null) + return existingValue; + + return Newtonsoft.Json.JsonConvert.DeserializeObject(value); + } + + throw new Newtonsoft.Json.JsonReaderException(); + } + + public override void WriteJson(Newtonsoft.Json.JsonWriter writer, Types.Picture? value, Newtonsoft.Json.JsonSerializer serializer) + { + if (value != null) + writer.WriteValue(Newtonsoft.Json.JsonConvert.SerializeObject(value, Newtonsoft.Json.Formatting.None)); + else + writer.WriteNull(); + } + } + + internal class SystemTextJsonPictureConverter : System.Text.Json.Serialization.JsonConverter + { + public override Types.Picture? Read(ref System.Text.Json.Utf8JsonReader reader, Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType == System.Text.Json.JsonTokenType.Null) + { + return null; + } + else if (reader.TokenType == System.Text.Json.JsonTokenType.String) + { + string? value = reader.GetString(); + if (value == null) + return null; + + return System.Text.Json.JsonSerializer.Deserialize(value, options); + } + + throw new System.Text.Json.JsonException(); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Types.Picture? value, System.Text.Json.JsonSerializerOptions options) + { + if (value != null) + writer.WriteStringValue(System.Text.Json.JsonSerializer.Serialize(value, options)); + else + writer.WriteNullValue(); + } + } + } + + /// + /// 获取或设置门店 ID。 + /// + [Newtonsoft.Json.JsonProperty("poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("poi_id")] + public string POIId { get; set; } = string.Empty; + + /// + /// 获取或设置腾讯地图的位置点 ID。 + /// + [Newtonsoft.Json.JsonProperty("map_poi_id")] + [System.Text.Json.Serialization.JsonPropertyName("map_poi_id")] + public string MapPOIId { get; set; } = string.Empty; + + /// + /// 获取或设置门店图片信息。 + /// + [Newtonsoft.Json.JsonProperty("pic_list")] + [Newtonsoft.Json.JsonConverter(typeof(Converters.NewtonsoftJsonPictureConverter))] + [System.Text.Json.Serialization.JsonPropertyName("pic_list")] + [System.Text.Json.Serialization.JsonConverter(typeof(Converters.SystemTextJsonPictureConverter))] + public Types.Picture Picture { get; set; } = new Types.Picture(); + + /// + /// 获取或设置营业时间(格式:HHmm-HHmm)。 + /// + [Newtonsoft.Json.JsonProperty("hour")] + [System.Text.Json.Serialization.JsonPropertyName("hour")] + public string BusinessHours { get; set; } = string.Empty; + + /// + /// 获取或设置门店电话。 + /// + [Newtonsoft.Json.JsonProperty("contract_phone")] + [System.Text.Json.Serialization.JsonPropertyName("contract_phone")] + public string Telephone { get; set; } = string.Empty; + + /// + /// 获取或设置卡券 ID。 + /// + [Newtonsoft.Json.JsonProperty("card_id")] + [System.Text.Json.Serialization.JsonPropertyName("card_id")] + public string CardId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaUpdateStoreResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaUpdateStoreResponse.cs new file mode 100644 index 00000000..9ff2d3d1 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaUpdateStoreResponse.cs @@ -0,0 +1,37 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /wxa/update_store 接口的响应。 + /// + public class WxaUpdateStoreResponse : WechatApiResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置是否需要审核。 + /// + [Newtonsoft.Json.JsonProperty("has_audit_id")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumberTypedBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("has_audit_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumberTypedBooleanConverter))] + public bool RequireAudit { get; set; } + + /// + /// 获取或设置审核单 ID。 + /// + [Newtonsoft.Json.JsonProperty("audit_id")] + [System.Text.Json.Serialization.JsonPropertyName("audit_id")] + public int? AuditId { get; set; } + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("data")] + [System.Text.Json.Serialization.JsonPropertyName("data")] + public Types.Data Data { get; set; } = default!; + } +}