feat(wxapi): 新增微信门店小程序相关 API 封装

This commit is contained in:
Fu Diwei
2021-06-13 18:30:13 +08:00
parent 52d8cd3223
commit 1a3aba1f5a
38 changed files with 1687 additions and 34 deletions

View File

@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
{
/// <summary>
/// <para>表示 EVENT.create_map_poi_audit_info 事件的数据。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#11 </para>
/// </summary>
public class CreateMapPOIAuditInfoEvent : WechatApiEvent, WechatApiEvent.Types.IJsonSerializable, WechatApiEvent.Types.IXmlSerializable
{
/// <summary>
/// 获取或设置审核单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("audit_id")]
[System.Text.Json.Serialization.JsonPropertyName("audit_id")]
[System.Xml.Serialization.XmlElement("audit_id")]
public int AuditId { get; set; }
/// <summary>
/// 获取或设置审核状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
[System.Xml.Serialization.XmlElement("status")]
public int AuditStatus { get; set; }
/// <summary>
/// 获取或设置腾讯地图的位置点 ID。
/// </summary>
[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!;
/// <summary>
/// 获取或设置门店名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
[System.Xml.Serialization.XmlElement("name")]
public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置门店详细地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("address")]
[System.Text.Json.Serialization.JsonPropertyName("address")]
[System.Xml.Serialization.XmlElement("address")]
public string Address { get; set; } = default!;
/// <summary>
/// 获取或设置门店位置经度。
/// </summary>
[Newtonsoft.Json.JsonProperty("longitude")]
[System.Text.Json.Serialization.JsonPropertyName("longitude")]
[System.Xml.Serialization.XmlElement("longitude")]
public double Longitude { get; set; }
/// <summary>
/// 获取或设置门店位置纬度。
/// </summary>
[Newtonsoft.Json.JsonProperty("latitude")]
[System.Text.Json.Serialization.JsonPropertyName("latitude")]
[System.Xml.Serialization.XmlElement("latitude")]
public double Latitude { get; set; }
/// <summary>
/// 获取或设置备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("sh_remark")]
[System.Text.Json.Serialization.JsonPropertyName("sh_remark")]
[System.Xml.Serialization.XmlElement("sh_remark")]
public string Remark { get; set; } = default!;
}
}

View File

@@ -1093,5 +1093,49 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendRequestWithJsonAsync<Models.CardSubMerchantBatchGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region WxaStore
/// <summary>
/// <para>异步调用 [POST] /card/storewxa/get 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#18 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CardStoreWxaGetResponse> 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<Models.CardStoreWxaGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /card/storewxa/set 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#18 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CardStoreWxaSetResponse> 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<Models.CardStoreWxaSetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
}
}

View File

@@ -56,6 +56,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/poi/getpoilist 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Store_Interface.html#10 </para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#17 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>

View File

@@ -848,5 +848,259 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendRequestWithJsonAsync<Models.WxaServiceMarketRetrieveResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region WxaStore
/// <summary>
/// <para>异步调用 [GET] /wxa/get_merchant_category 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#5 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaGetMerchantCategoryResponse> 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<Models.WxaGetMerchantCategoryResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/apply_merchant 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#6 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaApplyMerchantResponse> 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<Models.WxaApplyMerchantResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /wxa/get_merchant_audit_info 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#7 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaGetMerchantAuditInfoResponse> 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<Models.WxaGetMerchantAuditInfoResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/modify_merchant 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#8 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaModifyMerchantResponse> 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<Models.WxaModifyMerchantResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /wxa/get_district 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#9 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaGetDistrictResponse> 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<Models.WxaGetDistrictResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/search_map_poi 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#10 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaSearchMapPOIResponse> 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<Models.WxaSearchMapPOIResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/create_map_poi 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#11 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaCreateMapPOIResponse> 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<Models.WxaCreateMapPOIResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/add_store 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#12 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaAddStoreResponse> 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<Models.WxaAddStoreResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/update_store 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#13 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaUpdateStoreResponse> 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<Models.WxaUpdateStoreResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/get_store_info 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#14 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaGetStoreInfoResponse> 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<Models.WxaGetStoreInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/get_store_list 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#15 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaGetStoreListResponse> 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<Models.WxaGetStoreListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/del_store 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/WeChat_Stores/WeChat_Shop_Miniprogram_Interface.html#16 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaDeleteStoreResponse> 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<Models.WxaDeleteStoreResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /card/storewxa/get 接口的请求。</para>
/// </summary>
public class CardStoreWxaGetRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置门店 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("poi_id")]
public string POIId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /card/storewxa/get 接口的响应。</para>
/// </summary>
public class CardStoreWxaGetResponse : WechatApiResponse
{
/// <summary>
/// 获取或设置卡券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_id")]
[System.Text.Json.Serialization.JsonPropertyName("card_id")]
public string? CardId { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /card/storewxa/set 接口的请求。</para>
/// </summary>
public class CardStoreWxaSetRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置门店 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("poi_id")]
public string POIId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置卡券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_id")]
[System.Text.Json.Serialization.JsonPropertyName("card_id")]
public string CardId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /card/storewxa/set 接口的响应。</para>
/// </summary>
public class CardStoreWxaSetResponse : WechatApiResponse
{
}
}

View File

@@ -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
/// 获取或设置营业时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_time")]
[System.Text.Json.Serialization.JsonPropertyName("intopen_timeroduction")]
[System.Text.Json.Serialization.JsonPropertyName("open_time")]
public string? OpenTime { get; set; }
/// <summary>
@@ -171,6 +171,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[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();
}
}

View File

@@ -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
{
/// <summary>
/// 获取或设置商户门店 ID。
/// 获取或设置门店 ID。
/// </summary>
[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!;
/// <summary>
/// 获取或设置腾讯地图的位置点 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("mapid")]
[System.Text.Json.Serialization.JsonPropertyName("mapid")]
public string? MapPOIId { get; set; }
/// <summary>
/// 获取或设置迁移状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("upgrade_status")]
[System.Text.Json.Serialization.JsonPropertyName("upgrade_status")]
public int? UpgradeStatus { get; set; }
/// <summary>
/// 获取或设置迁移驳回的理由。
/// </summary>
[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
/// </summary>
[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!;
/// <summary>
/// 获取或设置门店总数量。

View File

@@ -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
/// 获取或设置营业时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_time")]
[System.Text.Json.Serialization.JsonPropertyName("intopen_timeroduction")]
[System.Text.Json.Serialization.JsonPropertyName("open_time")]
public string? OpenTime { get; set; }
/// <summary>
@@ -185,6 +185,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("business")]
[System.Text.Json.Serialization.JsonPropertyName("business")]
public Types.Business Business { get; set; } = default!;
public Types.POI POI { get; set; } = default!;
}
}

View File

@@ -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
/// 获取或设置营业时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_time")]
[System.Text.Json.Serialization.JsonPropertyName("intopen_timeroduction")]
[System.Text.Json.Serialization.JsonPropertyName("open_time")]
public string? OpenTime { get; set; }
/// <summary>

View File

@@ -46,7 +46,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("url")]
[System.Text.Json.Serialization.JsonPropertyName("url")]
public string ExampleUrl { get; set; } = default!;
public string? ExampleUrl { get; set; }
}
}

View File

@@ -310,6 +310,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
}
}
/// <summary>
/// 获取或设置附近地点 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("poi_id")]
public string POIId { get; set; } = string.Empty;
/// <summary>
/// <i>(使用默认值即可,无需修改)</i>
/// </summary>
@@ -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;
/// <summary>
/// 获取或设置腾讯地图的位置点 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("map_poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("map_poi_id")]
public string? MapPOIId { get; set; }
/// <summary>
/// 获取或设置门店图片信息。
/// </summary>
@@ -351,7 +365,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[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;
/// <summary>
/// 获取或设置营业时间格式HHmm-HHmm
@@ -365,14 +379,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("address")]
[System.Text.Json.Serialization.JsonPropertyName("address")]
public string Addres { get; set; } = string.Empty;
/// <summary>
/// 获取或设置附近地点 ID。
/// </summary>
[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;
/// <summary>
/// 获取或设置主体名称。
@@ -386,27 +393,20 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[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;
/// <summary>
/// 获取或设置经营资质证件号。
/// </summary>
[Newtonsoft.Json.JsonProperty("credential")]
[System.Text.Json.Serialization.JsonPropertyName("credential")]
public string Credential { get; set; } = string.Empty;
public string LicenseNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置证明材料媒体文件标识。
/// 获取或设置证明材料媒体文件标识列表
/// </summary>
[Newtonsoft.Json.JsonProperty("qualification_list")]
[System.Text.Json.Serialization.JsonPropertyName("qualification_list")]
public string? QualificationMediaId { get; set; }
/// <summary>
/// 获取或设置对应《在腾讯地图中搜索门店》中的 `sosomap_poi_uid` 字段。
/// </summary>
[Newtonsoft.Json.JsonProperty("map_poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("map_poi_id")]
public string? MapPOIId { get; set; }
public IList<string>? QualificationMediaIdList { get; set; }
}
}

View File

@@ -0,0 +1,167 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/add_store 接口的请求。</para>
/// </summary>
public class WxaAddStoreRequest : WechatApiRequest
{
public static class Types
{
public class Picture
{
/// <summary>
/// 获取或设置门店图片 URL 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("list")]
[System.Text.Json.Serialization.JsonPropertyName("list")]
public IList<string> PictureUrlList { get; set; } = new List<string>();
}
}
internal static class Converters
{
internal class NewtonsoftJsonPictureConverter : Newtonsoft.Json.JsonConverter<Types.Picture?>
{
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<string>(reader);
if (value == null)
return existingValue;
return Newtonsoft.Json.JsonConvert.DeserializeObject<Types.Picture>(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<Types.Picture?>
{
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<Types.Picture>(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();
}
}
}
/// <summary>
/// 获取或设置原门店 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("poi_id")]
public string? POIId { get; set; }
/// <summary>
/// 获取或设置腾讯地图的位置点 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("map_poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("map_poi_id")]
public string MapPOIId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店图片信息。
/// </summary>
[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();
/// <summary>
/// 获取或设置营业时间格式HHmm-HHmm
/// </summary>
[Newtonsoft.Json.JsonProperty("hour")]
[System.Text.Json.Serialization.JsonPropertyName("hour")]
public string BusinessHours { get; set; } = string.Empty;
/// <summary>
/// 获取或设置地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("address")]
[System.Text.Json.Serialization.JsonPropertyName("address")]
public string Address { get; set; } = string.Empty;
/// <summary>
/// 获取或设置主体名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("company_name")]
[System.Text.Json.Serialization.JsonPropertyName("company_name")]
public string CompanyName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店电话。
/// </summary>
[Newtonsoft.Json.JsonProperty("contract_phone")]
[System.Text.Json.Serialization.JsonPropertyName("contract_phone")]
public string Telephone { get; set; } = string.Empty;
/// <summary>
/// 获取或设置经营资质证件号。
/// </summary>
[Newtonsoft.Json.JsonProperty("credential")]
[System.Text.Json.Serialization.JsonPropertyName("credential")]
public string LicenseNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置证明材料媒体文件标识列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("qualification_list")]
[System.Text.Json.Serialization.JsonPropertyName("qualification_list")]
public IList<string>? QualificationMediaIdList { get; set; }
/// <summary>
/// 获取或设置卡券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_id")]
[System.Text.Json.Serialization.JsonPropertyName("card_id")]
public string CardId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,28 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/add_store 接口的响应。</para>
/// </summary>
public class WxaAddStoreResponse : WechatApiResponse
{
public static class Types
{
public class Data
{
/// <summary>
/// 获取或设置审核单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("audit_id")]
[System.Text.Json.Serialization.JsonPropertyName("audit_id")]
public int AuditId { get; set; }
}
}
/// <summary>
/// 获取或设置返回数据。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public Types.Data Data { get; set; } = default!;
}
}

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/apply_merchant 接口的请求。</para>
/// </summary>
public class WxaApplyMerchantRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置一级类目 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("first_catid")]
[System.Text.Json.Serialization.JsonPropertyName("first_catid")]
public int FirstCategoryId { get; set; }
/// <summary>
/// 获取或设置二级类目 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("second_catid")]
[System.Text.Json.Serialization.JsonPropertyName("second_catid")]
public int SecondCategoryId { get; set; }
/// <summary>
/// 获取或设置类目相关证件的媒体文件标识列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("qualification_list")]
[System.Text.Json.Serialization.JsonPropertyName("qualification_list")]
public IList<string>? QualificationMediaIdList { get; set; }
/// <summary>
/// 获取或设置门店小程序的昵称。
/// </summary>
[Newtonsoft.Json.JsonProperty("nickname")]
[System.Text.Json.Serialization.JsonPropertyName("nickname")]
public string Nickname { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店小程序的介绍。
/// </summary>
[Newtonsoft.Json.JsonProperty("intro")]
[System.Text.Json.Serialization.JsonPropertyName("intro")]
public string Introduction { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店小程序的头像媒体文件标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("headimg_mediaid")]
[System.Text.Json.Serialization.JsonPropertyName("headimg_mediaid")]
public string HeadImageMediaId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置营业执照图片媒体文件标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("org_code")]
[System.Text.Json.Serialization.JsonPropertyName("org_code")]
public string? LicenseMediaId { get; set; }
/// <summary>
/// 获取或设置其他证明材料的媒体文件标识列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("other_files")]
[System.Text.Json.Serialization.JsonPropertyName("other_files")]
public IList<string>? OtherFileMediaIdList { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/apply_merchant 接口的响应。</para>
/// </summary>
public class WxaApplyMerchantResponse : WechatApiResponse
{
}
}

View File

@@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/create_map_poi 接口的请求。</para>
/// </summary>
public class WxaCreateMapPOIRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置原门店 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("poi_id")]
public string? POIId { get; set; }
/// <summary>
/// 获取或设置门店名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店分类。
/// </summary>
[Newtonsoft.Json.JsonProperty("category")]
[System.Text.Json.Serialization.JsonPropertyName("category")]
public string Category { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店介绍。
/// </summary>
[Newtonsoft.Json.JsonProperty("introduct")]
[System.Text.Json.Serialization.JsonPropertyName("introduct")]
public string Introduction { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店电话。
/// </summary>
[Newtonsoft.Json.JsonProperty("telephone")]
[System.Text.Json.Serialization.JsonPropertyName("telephone")]
public string Telephone { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店位置经度。
/// </summary>
[Newtonsoft.Json.JsonProperty("longitude")]
[System.Text.Json.Serialization.JsonPropertyName("longitude")]
public double Longitude { get; set; }
/// <summary>
/// 获取或设置门店位置纬度。
/// </summary>
[Newtonsoft.Json.JsonProperty("latitude")]
[System.Text.Json.Serialization.JsonPropertyName("latitude")]
public double Latitude { get; set; }
/// <summary>
/// 获取或设置门店区域 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("districtid")]
[System.Text.Json.Serialization.JsonPropertyName("districtid")]
public int DistrictId { get; set; }
/// <summary>
/// 获取或设置门店所在省份。
/// </summary>
[Newtonsoft.Json.JsonProperty("province")]
[System.Text.Json.Serialization.JsonPropertyName("province")]
public string Province { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店所在城市。
/// </summary>
[Newtonsoft.Json.JsonProperty("city")]
[System.Text.Json.Serialization.JsonPropertyName("city")]
public string City { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店所在区县。
/// </summary>
[Newtonsoft.Json.JsonProperty("district")]
[System.Text.Json.Serialization.JsonPropertyName("district")]
public string District { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店详细地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("address")]
[System.Text.Json.Serialization.JsonPropertyName("address")]
public string Address { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店图片媒体文件标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("photo")]
[System.Text.Json.Serialization.JsonPropertyName("photo")]
public string PictureMediaId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置营业执照图片媒体文件标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("license")]
[System.Text.Json.Serialization.JsonPropertyName("license")]
public string LicenseMediaId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,28 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/create_map_poi 接口的响应。</para>
/// </summary>
public class WxaCreateMapPOIResponse : WechatApiResponse
{
public static class Types
{
public class Data
{
/// <summary>
/// 获取或设置审核单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("base_id")]
[System.Text.Json.Serialization.JsonPropertyName("base_id")]
public int AuditId { get; set; }
}
}
/// <summary>
/// 获取或设置返回数据。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public Types.Data Data { get; set; } = default!;
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/del_store 接口的请求。</para>
/// </summary>
public class WxaDeleteStoreRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置门店 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("poi_id")]
public string POIId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/del_store 接口的响应。</para>
/// </summary>
public class WxaDeleteStoreResponse : WechatApiResponse
{
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /wxa/get_district 接口的请求。</para>
/// </summary>
public class WxaGetDistrictRequest : WechatApiRequest
{
}
}

View File

@@ -0,0 +1,90 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /wxa/get_district 接口的响应。</para>
/// </summary>
public class WxaGetDistrictResponse : WechatApiResponse
{
public static class Types
{
public class District
{
public static class Types
{
public class Location
{
/// <summary>
/// 获取或设置经度。
/// </summary>
[Newtonsoft.Json.JsonProperty("lng")]
[System.Text.Json.Serialization.JsonPropertyName("lng")]
public double Longitude { get; set; }
/// <summary>
/// 获取或设置纬度。
/// </summary>
[Newtonsoft.Json.JsonProperty("lat")]
[System.Text.Json.Serialization.JsonPropertyName("lat")]
public double Latitude { get; set; }
}
}
/// <summary>
/// 获取或设置区域 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("id")]
[System.Text.Json.Serialization.JsonPropertyName("id")]
public int DistrictId { get; set; }
/// <summary>
/// 获取或设置区域名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置区域全称。
/// </summary>
[Newtonsoft.Json.JsonProperty("fullname")]
[System.Text.Json.Serialization.JsonPropertyName("fullname")]
public string FullName { get; set; } = default!;
/// <summary>
/// 获取或设置区域经纬度信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("location")]
[System.Text.Json.Serialization.JsonPropertyName("location")]
public Types.Location? Location { get; set; }
/// <summary>
/// 获取或设置区域拼音。
/// </summary>
[Newtonsoft.Json.JsonProperty("pinyin")]
[System.Text.Json.Serialization.JsonPropertyName("pinyin")]
public string[]? Pinyin { get; set; }
/// <summary>
/// 获取或设置下属城市区域 ID 列表
/// </summary>
[Newtonsoft.Json.JsonProperty("cidx")]
[System.Text.Json.Serialization.JsonPropertyName("cidx")]
public int[]? CityIdList { get; set; }
}
}
/// <summary>
/// 获取或设置数据版本号。
/// </summary>
[Newtonsoft.Json.JsonProperty("data_version")]
[System.Text.Json.Serialization.JsonPropertyName("data_version")]
public string DataVersion { get; set; } = default!;
/// <summary>
/// 获取或设置区域列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("result")]
[System.Text.Json.Serialization.JsonPropertyName("result")]
public Types.District[][] DistrictList { get; set; } = default!;
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /wxa/get_merchant_audit_info 接口的请求。</para>
/// </summary>
public class WxaGetMerchantAuditInfoRequest : WechatApiRequest
{
}
}

View File

@@ -0,0 +1,42 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /wxa/get_merchant_audit_info 接口的响应。</para>
/// </summary>
public class WxaGetMerchantAuditInfoResponse : WechatApiResponse
{
public static class Types
{
public class Data
{
/// <summary>
/// 获取或设置审核单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("audit_id")]
[System.Text.Json.Serialization.JsonPropertyName("audit_id")]
public int AuditId { get; set; }
/// <summary>
/// 获取或设置审核状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int AuditStatus { get; set; }
/// <summary>
/// 获取或设置审核拒绝原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("reason")]
[System.Text.Json.Serialization.JsonPropertyName("reason")]
public string? AuditRejectReason { get; set; }
}
}
/// <summary>
/// 获取或设置返回数据。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public Types.Data Data { get; set; } = default!;
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /wxa/get_merchant_category 接口的请求。</para>
/// </summary>
public class WxaGetMerchantCategoryRequest : WechatApiRequest
{
}
}

View File

@@ -0,0 +1,45 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /wxa/get_merchant_category 接口的响应。</para>
/// </summary>
public class WxaGetMerchantCategoryResponse : WechatApiResponse
{
public static class Types
{
public class Data
{
public static class Types
{
public class CategoryList
{
/// <summary>
/// 获取或设置分类列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("categories")]
[System.Text.Json.Serialization.JsonPropertyName("categories")]
public CategoryItem[] Items { get; set; } = default!;
}
public class CategoryItem : CgibinWxopenGetAllCategoriesResponse.Types.CategoryItem
{
}
}
/// <summary>
/// 获取或设置分类列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("all_category_info")]
[System.Text.Json.Serialization.JsonPropertyName("all_category_info")]
public Types.CategoryList CategoryList { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置返回数据。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public Types.Data Data { get; set; } = default!;
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/get_store_info 接口的请求。</para>
/// </summary>
public class WxaGetStoreInfoRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置门店 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("poi_id")]
public string POIId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,131 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/get_store_info 接口的响应。</para>
/// </summary>
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
{
/// <summary>
/// 获取或设置图片 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("photo_url")]
[System.Text.Json.Serialization.JsonPropertyName("photo_url")]
public string PictureUrl { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置门店 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("poi_id")]
public string POIId { get; set; } = default!;
/// <summary>
/// 获取或设置门店名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("business_name")]
[System.Text.Json.Serialization.JsonPropertyName("business_name")]
public string BusinessName { get; set; } = default!;
/// <summary>
/// 获取或设置省份。
/// </summary>
[Newtonsoft.Json.JsonProperty("province")]
[System.Text.Json.Serialization.JsonPropertyName("province")]
public string Province { get; set; } = default!;
/// <summary>
/// 获取或设置城市。
/// </summary>
[Newtonsoft.Json.JsonProperty("city")]
[System.Text.Json.Serialization.JsonPropertyName("city")]
public string City { get; set; } = default!;
/// <summary>
/// 获取或设置区县。
/// </summary>
[Newtonsoft.Json.JsonProperty("district")]
[System.Text.Json.Serialization.JsonPropertyName("district")]
public string District { get; set; } = default!;
/// <summary>
/// 获取或设置详细地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("address")]
[System.Text.Json.Serialization.JsonPropertyName("address")]
public string Address { get; set; } = default!;
/// <summary>
/// 获取或设置联系电话。
/// </summary>
[Newtonsoft.Json.JsonProperty("telephone")]
[System.Text.Json.Serialization.JsonPropertyName("telephone")]
public string Telephone { get; set; } = default!;
/// <summary>
/// 获取或设置经度。
/// </summary>
[Newtonsoft.Json.JsonProperty("longitude")]
[System.Text.Json.Serialization.JsonPropertyName("longitude")]
public double Longitude { get; set; }
/// <summary>
/// 获取或设置纬度。
/// </summary>
[Newtonsoft.Json.JsonProperty("latitude")]
[System.Text.Json.Serialization.JsonPropertyName("latitude")]
public double Latitude { get; set; }
/// <summary>
/// 获取或设置营业时间格式HHmm-HHmm
/// </summary>
[Newtonsoft.Json.JsonProperty("open_time")]
[System.Text.Json.Serialization.JsonPropertyName("open_time")]
public string BusinessHours { get; set; } = default!;
/// <summary>
/// 获取或设置门店图片列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("photo_list")]
[System.Text.Json.Serialization.JsonPropertyName("photo_list")]
public Types.Picture[]? PictureList { get; set; }
/// <summary>
/// 获取或设置审核状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
}
}
/// <summary>
/// 获取或设置门店基本信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("base_info")]
[System.Text.Json.Serialization.JsonPropertyName("base_info")]
public Types.Base Base { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置门店信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("business")]
[System.Text.Json.Serialization.JsonPropertyName("business")]
public Types.POI POI { get; set; } = default!;
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/get_store_list 接口的请求。</para>
/// </summary>
public class WxaGetStoreListRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置分页起始位置。
/// </summary>
[Newtonsoft.Json.JsonProperty("offset")]
[System.Text.Json.Serialization.JsonPropertyName("offset")]
public int Offset { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("limit")]
[System.Text.Json.Serialization.JsonPropertyName("limit")]
public int Limit { get; set; } = 20;
}
}

View File

@@ -0,0 +1,42 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/get_store_list 接口的响应。</para>
/// </summary>
public class WxaGetStoreListResponse : WechatApiResponse
{
public static class Types
{
public class POI
{
public static class Types
{
public class Base : WxaGetStoreInfoResponse.Types.POI.Types.Base
{
}
}
/// <summary>
/// 获取或设置门店基本信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("base_info")]
[System.Text.Json.Serialization.JsonPropertyName("base_info")]
public Types.Base Base { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置门店列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("business_list")]
[System.Text.Json.Serialization.JsonPropertyName("business_list")]
public Types.POI[] POIList { get; set; } = default!;
/// <summary>
/// 获取或设置门店总数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_count")]
[System.Text.Json.Serialization.JsonPropertyName("total_count")]
public int Total { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/modify_merchant 接口的请求。</para>
/// </summary>
public class WxaModifyMerchantRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置门店小程序的介绍。
/// </summary>
[Newtonsoft.Json.JsonProperty("intro")]
[System.Text.Json.Serialization.JsonPropertyName("intro")]
public string Introduction { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店小程序的头像媒体文件标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("headimg_mediaid")]
[System.Text.Json.Serialization.JsonPropertyName("headimg_mediaid")]
public string HeadImageMediaId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/modify_merchant 接口的响应。</para>
/// </summary>
public class WxaModifyMerchantResponse : WechatApiResponse
{
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/search_map_poi 接口的请求。</para>
/// </summary>
public class WxaSearchMapPOIRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置区域 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("districtid")]
[System.Text.Json.Serialization.JsonPropertyName("districtid")]
public int DistrictId { get; set; }
/// <summary>
/// 获取或设置搜索的关键字。
/// </summary>
[Newtonsoft.Json.JsonProperty("keyword")]
[System.Text.Json.Serialization.JsonPropertyName("keyword")]
public string Keyword { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,97 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/search_map_poi 接口的响应。</para>
/// </summary>
public class WxaSearchMapPOIResponse : WechatApiResponse
{
public static class Types
{
public class Data
{
public static class Types
{
public class POI
{
/// <summary>
/// 获取或设置腾讯地图的位置点 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("sosomap_poi_uid")]
[System.Text.Json.Serialization.JsonPropertyName("sosomap_poi_uid")]
public string MapPOIId { get; set; } = default!;
/// <summary>
/// 获取或设置分店名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("branch_name")]
[System.Text.Json.Serialization.JsonPropertyName("branch_name")]
public string BranchName { get; set; } = default!;
/// <summary>
/// 获取或设置门店分类。
/// </summary>
[Newtonsoft.Json.JsonProperty("category")]
[System.Text.Json.Serialization.JsonPropertyName("category")]
public string Category { get; set; } = default!;
/// <summary>
/// 获取或设置门店详细地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("address")]
[System.Text.Json.Serialization.JsonPropertyName("address")]
public string Address { get; set; } = default!;
/// <summary>
/// 获取或设置门店电话。
/// </summary>
[Newtonsoft.Json.JsonProperty("telephone")]
[System.Text.Json.Serialization.JsonPropertyName("telephone")]
public string Telephone { get; set; } = default!;
/// <summary>
/// 获取或设置门店位置经度。
/// </summary>
[Newtonsoft.Json.JsonProperty("longitude")]
[System.Text.Json.Serialization.JsonPropertyName("longitude")]
public double Longitude { get; set; }
/// <summary>
/// 获取或设置门店位置纬度。
/// </summary>
[Newtonsoft.Json.JsonProperty("latitude")]
[System.Text.Json.Serialization.JsonPropertyName("latitude")]
public double Latitude { get; set; }
/// <summary>
/// 获取或设置门店图片 URL 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("pic_urls")]
[System.Text.Json.Serialization.JsonPropertyName("pic_urls")]
public string[]? PictureUrlList { get; set; }
/// <summary>
/// 获取或设置卡券 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_id_list")]
[System.Text.Json.Serialization.JsonPropertyName("card_id_list")]
public string[]? CardIdList { get; set; }
}
}
/// <summary>
/// 获取或设置门店列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("item")]
[System.Text.Json.Serialization.JsonPropertyName("item")]
public Types.POI[] POIList { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置返回数据。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public Types.Data Data { get; set; } = default!;
}
}

View File

@@ -0,0 +1,133 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/update_store 接口的请求。</para>
/// </summary>
public class WxaUpdateStoreRequest : WechatApiRequest
{
public static class Types
{
public class Picture : WxaAddStoreRequest.Types.Picture
{
}
}
internal static class Converters
{
internal class NewtonsoftJsonPictureConverter : Newtonsoft.Json.JsonConverter<Types.Picture?>
{
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<string>(reader);
if (value == null)
return existingValue;
return Newtonsoft.Json.JsonConvert.DeserializeObject<Types.Picture>(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<Types.Picture?>
{
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<Types.Picture>(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();
}
}
}
/// <summary>
/// 获取或设置门店 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("poi_id")]
public string POIId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置腾讯地图的位置点 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("map_poi_id")]
[System.Text.Json.Serialization.JsonPropertyName("map_poi_id")]
public string MapPOIId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店图片信息。
/// </summary>
[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();
/// <summary>
/// 获取或设置营业时间格式HHmm-HHmm
/// </summary>
[Newtonsoft.Json.JsonProperty("hour")]
[System.Text.Json.Serialization.JsonPropertyName("hour")]
public string BusinessHours { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店电话。
/// </summary>
[Newtonsoft.Json.JsonProperty("contract_phone")]
[System.Text.Json.Serialization.JsonPropertyName("contract_phone")]
public string Telephone { get; set; } = string.Empty;
/// <summary>
/// 获取或设置卡券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_id")]
[System.Text.Json.Serialization.JsonPropertyName("card_id")]
public string CardId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,37 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/update_store 接口的响应。</para>
/// </summary>
public class WxaUpdateStoreResponse : WechatApiResponse
{
public static class Types
{
public class Data
{
/// <summary>
/// 获取或设置是否需要审核。
/// </summary>
[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; }
/// <summary>
/// 获取或设置审核单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("audit_id")]
[System.Text.Json.Serialization.JsonPropertyName("audit_id")]
public int? AuditId { get; set; }
}
}
/// <summary>
/// 获取或设置返回数据。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public Types.Data Data { get; set; } = default!;
}
}