feat(wxapi): 新增视频号小店地址管理相关接口

This commit is contained in:
Fu Diwei
2022-11-02 18:35:14 +08:00
parent 9a4510796f
commit 5c899a2fcb
30 changed files with 744 additions and 97 deletions

View File

@@ -199,6 +199,108 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendRequestWithJsonAsync<Models.ChannelsECMerchantUpdateFreightTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region Merchant/Address
/// <summary>
/// <para>异步调用 [POST] /channels/ec/merchant/address/list 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/merchant/address/list.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECMerchantAddressListResponse> ExecuteChannelsECMerchantAddressListAsync(this WechatApiClient client, Models.ChannelsECMerchantAddressListRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "address", "list")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ChannelsECMerchantAddressListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /channels/ec/merchant/address/get 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/merchant/address/get.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECMerchantAddressGetResponse> ExecuteChannelsECMerchantAddressGetAsync(this WechatApiClient client, Models.ChannelsECMerchantAddressGetRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "address", "get")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ChannelsECMerchantAddressGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /channels/ec/merchant/address/add 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/merchant/address/add.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECMerchantAddressAddResponse> ExecuteChannelsECMerchantAddressAddAsync(this WechatApiClient client, Models.ChannelsECMerchantAddressAddRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "address", "add")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ChannelsECMerchantAddressAddResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /channels/ec/merchant/address/update 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/merchant/address/update.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECMerchantAddressUpdateResponse> ExecuteChannelsECMerchantAddressUpdateAsync(this WechatApiClient client, Models.ChannelsECMerchantAddressUpdateRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "address", "update")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ChannelsECMerchantAddressUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /channels/ec/merchant/address/delete 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/merchant/address/delete.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECMerchantAddressDeleteResponse> ExecuteChannelsECMerchantAddressDeleteAsync(this WechatApiClient client, Models.ChannelsECMerchantAddressDeleteRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "address", "delete")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ChannelsECMerchantAddressDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#endregion
#region Order

View File

@@ -0,0 +1,133 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/merchant/address/add 接口的请求。</para>
/// </summary>
public class ChannelsECMerchantAddressAddRequest : WechatApiRequest, IInferable<ChannelsECMerchantAddressAddRequest, ChannelsECMerchantAddressAddResponse>
{
public static class Types
{
public class AddressDetail
{
public static class Types
{
public class Address : ChannelsECMerchantAddFreightTemplateRequest.Types.FreightTemplate.Types.Address
{
/// <summary>
/// 获取或设置门牌号。
/// </summary>
[Newtonsoft.Json.JsonProperty("house_number")]
[System.Text.Json.Serialization.JsonPropertyName("house_number")]
public string? HouseNumber { get; set; }
/// <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; }
}
public class AddressType
{
/// <summary>
/// 获取或设置是否为同城配送地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("same_city")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("same_city")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))]
public bool? IsSupportSameCity { get; set; }
/// <summary>
/// 获取或设置是否为线下自提地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("pickup")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("pickup")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))]
public bool? IsSupportPickup { get; set; }
}
}
/// <summary>
/// 获取或设置地址信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_info")]
[System.Text.Json.Serialization.JsonPropertyName("address_info")]
public Types.Address Address { get; set; } = new Types.Address();
/// <summary>
/// 获取或设置地址类型信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_type")]
[System.Text.Json.Serialization.JsonPropertyName("address_type")]
public Types.AddressType? AddressType { get; set; }
/// <summary>
/// 获取或设置座机。
/// </summary>
[Newtonsoft.Json.JsonProperty("landline")]
[System.Text.Json.Serialization.JsonPropertyName("landline")]
public string? Landline { get; set; }
/// <summary>
/// 获取或设置备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("remark")]
[System.Text.Json.Serialization.JsonPropertyName("remark")]
public string? Remark { get; set; }
/// <summary>
/// 获取或设置是否为发货地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("send_addr")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("send_addr")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))]
public bool? IsSendAddress { get; set; }
/// <summary>
/// 获取或设置是否为默认发货地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("default_send")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("default_send")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))]
public bool? IsDefaultSendAddress { get; set; }
/// <summary>
/// 获取或设置是否为收货地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("recv_addr")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("recv_addr")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))]
public bool? IsReceiveAddress { get; set; }
/// <summary>
/// 获取或设置是否为默认收货地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("default_recv")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("default_recv")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))]
public bool? IsDefaultReceiveAddress { get; set; }
}
}
/// <summary>
/// 获取或设置地址详细信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_detail")]
[System.Text.Json.Serialization.JsonPropertyName("address_detail")]
public Types.AddressDetail AddressDetail { get; set; } = new Types.AddressDetail();
}
}

View File

@@ -0,0 +1,16 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/merchant/address/add 接口的响应。</para>
/// </summary>
public class ChannelsECMerchantAddressAddResponse : WechatApiResponse
{
/// <summary>
/// 获取或设置地址 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_id")]
[System.Text.Json.Serialization.JsonPropertyName("address_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long AddressId { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/merchant/address/delete 接口的请求。</para>
/// </summary>
public class ChannelsECMerchantAddressDeleteRequest : WechatApiRequest, IInferable<ChannelsECMerchantAddressDeleteRequest, ChannelsECMerchantAddressDeleteResponse>
{
/// <summary>
/// 获取或设置地址 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_id")]
[System.Text.Json.Serialization.JsonPropertyName("address_id")]
public long AddressId { get; set; }
}
}

View File

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

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/merchant/address/get 接口的请求。</para>
/// </summary>
public class ChannelsECMerchantAddressGetRequest : WechatApiRequest, IInferable<ChannelsECMerchantAddressGetRequest, ChannelsECMerchantAddressGetResponse>
{
/// <summary>
/// 获取或设置地址 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_id")]
[System.Text.Json.Serialization.JsonPropertyName("address_id")]
public long AddressId { get; set; }
}
}

View File

@@ -0,0 +1,155 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/merchant/address/get 接口的响应。</para>
/// </summary>
public class ChannelsECMerchantAddressGetResponse : WechatApiResponse
{
public static class Types
{
public class AddressDetail
{
public static class Types
{
public class Address : ChannelsECMerchantGetFreightTemplateDetailResponse.Types.FreightTemplate.Types.Address
{
/// <summary>
/// 获取或设置门牌号。
/// </summary>
[Newtonsoft.Json.JsonProperty("house_number")]
[System.Text.Json.Serialization.JsonPropertyName("house_number")]
public string? HouseNumber { get; set; }
/// <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; }
}
public class AddressType
{
/// <summary>
/// 获取或设置是否为同城配送地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("same_city")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("same_city")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))]
public bool IsSupportSameCity { get; set; }
/// <summary>
/// 获取或设置是否为线下自提地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("pickup")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("pickup")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))]
public bool IsSupportPickup { get; set; }
}
}
/// <summary>
/// 获取或设置地址 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_id")]
[System.Text.Json.Serialization.JsonPropertyName("address_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long AddressId { get; set; }
/// <summary>
/// 获取或设置地址信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_info")]
[System.Text.Json.Serialization.JsonPropertyName("address_info")]
public Types.Address Address { get; set; } = default!;
/// <summary>
/// 获取或设置地址类型信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_type")]
[System.Text.Json.Serialization.JsonPropertyName("address_type")]
public Types.AddressType? AddressType { get; set; } = default!;
/// <summary>
/// 获取或设置座机。
/// </summary>
[Newtonsoft.Json.JsonProperty("landline")]
[System.Text.Json.Serialization.JsonPropertyName("landline")]
public string? Landline { get; set; }
/// <summary>
/// 获取或设置备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("remark")]
[System.Text.Json.Serialization.JsonPropertyName("remark")]
public string? Remark { get; set; }
/// <summary>
/// 获取或设置是否为发货地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("send_addr")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("send_addr")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))]
public bool IsSendAddress { get; set; }
/// <summary>
/// 获取或设置是否为默认发货地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("default_send")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("default_send")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))]
public bool IsDefaultSendAddress { get; set; }
/// <summary>
/// 获取或设置是否为收货地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("recv_addr")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("recv_addr")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))]
public bool IsReceiveAddress { get; set; }
/// <summary>
/// 获取或设置是否为默认收货地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("default_recv")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("default_recv")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))]
public bool IsDefaultReceiveAddress { get; set; }
/// <summary>
/// 获取或设置更新时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
public long UpdateTimestamp { get; set; }
/// <summary>
/// 获取或设置创建时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
public long CreateTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置地址详细信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_detail")]
[System.Text.Json.Serialization.JsonPropertyName("address_detail")]
public Types.AddressDetail AddressDetail { get; set; } = default!;
}
}

View File

@@ -0,0 +1,23 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/merchant/address/list 接口的请求。</para>
/// </summary>
public class ChannelsECMerchantAddressListRequest : WechatApiRequest, IInferable<ChannelsECMerchantAddressListRequest, ChannelsECMerchantAddressListResponse>
{
/// <summary>
/// 获取或设置分页起始位置。
/// </summary>
[Newtonsoft.Json.JsonProperty("offset")]
[System.Text.Json.Serialization.JsonPropertyName("offset")]
public int Offset { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// <para>默认值10</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("limit")]
[System.Text.Json.Serialization.JsonPropertyName("limit")]
public int Limit { get; set; } = 10;
}
}

View File

@@ -0,0 +1,16 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/merchant/address/list 接口的响应。</para>
/// </summary>
public class ChannelsECMerchantAddressListResponse : WechatApiResponse
{
/// <summary>
/// 获取或设置地址 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_id_list")]
[System.Text.Json.Serialization.JsonPropertyName("address_id_list")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualLongArrayConverter))]
public long[] AddressIdList { get; set; } = default!;
}
}

View File

@@ -0,0 +1,53 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/merchant/address/update 接口的请求。</para>
/// </summary>
public class ChannelsECMerchantAddressUpdateRequest : WechatApiRequest, IInferable<ChannelsECMerchantAddressUpdateRequest, ChannelsECMerchantAddressUpdateResponse>
{
public static class Types
{
public class AddressDetail : ChannelsECMerchantAddressAddRequest.Types.AddressDetail
{
public static new class Types
{
public class Address : ChannelsECMerchantAddressAddRequest.Types.AddressDetail.Types.Address
{
}
public class AddressType : ChannelsECMerchantAddressAddRequest.Types.AddressDetail.Types.AddressType
{
}
}
/// <summary>
/// 获取或设置地址 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_id")]
[System.Text.Json.Serialization.JsonPropertyName("address_id")]
public long AddressId { get; set; }
/// <summary>
/// 获取或设置地址信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_info")]
[System.Text.Json.Serialization.JsonPropertyName("address_info")]
public new Types.Address Address { get; set; } = new Types.Address();
/// <summary>
/// 获取或设置地址类型信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_type")]
[System.Text.Json.Serialization.JsonPropertyName("address_type")]
public new Types.AddressType? AddressType { get; set; }
}
}
/// <summary>
/// 获取或设置地址详细信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_detail")]
[System.Text.Json.Serialization.JsonPropertyName("address_detail")]
public Types.AddressDetail AddressDetail { get; set; } = new Types.AddressDetail();
}
}

View File

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

View File

@@ -15,47 +15,47 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
public class Address
{
/// <summary>
/// 获取或设置联系人姓名。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
public string UserName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置邮政编码。
/// </summary>
[Newtonsoft.Json.JsonProperty("postal_code")]
[System.Text.Json.Serialization.JsonPropertyName("postal_code")]
public string? PostalCode { get; set; }
/// <summary>
/// 获取或设置省份。
/// </summary>
[Newtonsoft.Json.JsonProperty("province_name")]
[System.Text.Json.Serialization.JsonPropertyName("province_name")]
public string? Province { get; set; }
public string ProvinceName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置城市。
/// </summary>
[Newtonsoft.Json.JsonProperty("city_name")]
[System.Text.Json.Serialization.JsonPropertyName("city_name")]
public string? City { get; set; }
public string CityName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置区县。
/// </summary>
[Newtonsoft.Json.JsonProperty("county_name")]
[System.Text.Json.Serialization.JsonPropertyName("county_name")]
public string? District { get; set; }
public string DistrictName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置详细地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("detail_info")]
[System.Text.Json.Serialization.JsonPropertyName("detail_info")]
public string? Detail { get; set; }
/// <summary>
/// 获取或设置收件人姓名。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
public string? Name { get; set; }
/// <summary>
/// 获取或设置收件人电话。
/// </summary>
[Newtonsoft.Json.JsonProperty("tel_number")]
[System.Text.Json.Serialization.JsonPropertyName("tel_number")]
public string? TeleNumber { get; set; }
public string Detail { get; set; } = string.Empty;
/// <summary>
/// 获取或设置国家码。
@@ -65,11 +65,12 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
public string? NationalCode { get; set; }
/// <summary>
/// 获取或设置邮政编码。
/// 获取或设置电话号码。
/// </summary>
[Newtonsoft.Json.JsonProperty("postal_code")]
[System.Text.Json.Serialization.JsonPropertyName("postal_code")]
public string? PostalCode { get; set; }
[Newtonsoft.Json.JsonProperty("tel_number")]
[System.Text.Json.Serialization.JsonPropertyName("tel_number")]
public string TeleNumber { get; set; } = string.Empty;
}
public class Area

View File

@@ -13,26 +13,33 @@
{
public class Address
{
/// <summary>
/// 获取或设置收件人姓名。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
public string UserName { get; set; } = default!;
/// <summary>
/// 获取或设置省份。
/// </summary>
[Newtonsoft.Json.JsonProperty("province_name")]
[System.Text.Json.Serialization.JsonPropertyName("province_name")]
public string? Province { get; set; }
public string? ProvinceName { get; set; }
/// <summary>
/// 获取或设置城市。
/// </summary>
[Newtonsoft.Json.JsonProperty("city_name")]
[System.Text.Json.Serialization.JsonPropertyName("city_name")]
public string? City { get; set; }
public string? CityName { get; set; }
/// <summary>
/// 获取或设置区县。
/// </summary>
[Newtonsoft.Json.JsonProperty("county_name")]
[System.Text.Json.Serialization.JsonPropertyName("county_name")]
public string? District { get; set; }
public string? DistrictName { get; set; }
/// <summary>
/// 获取或设置详细地址。
@@ -42,25 +49,18 @@
public string? Detail { get; set; }
/// <summary>
/// 获取或设置收件人姓名
/// 获取或设置国家码
/// </summary>
[Newtonsoft.Json.JsonProperty("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
public string? Name { get; set; }
[Newtonsoft.Json.JsonProperty("national_code")]
[System.Text.Json.Serialization.JsonPropertyName("national_code")]
public string? NationalCode { get; set; }
/// <summary>
/// 获取或设置收件人电话。
/// </summary>
[Newtonsoft.Json.JsonProperty("tel_number")]
[System.Text.Json.Serialization.JsonPropertyName("tel_number")]
public string? TeleNumber { get; set; }
/// <summary>
/// 获取或设置国家码。
/// </summary>
[Newtonsoft.Json.JsonProperty("national_code")]
[System.Text.Json.Serialization.JsonPropertyName("national_code")]
public string? NationalCode { get; set; }
public string TeleNumber { get; set; } = default!;
/// <summary>
/// 获取或设置邮政编码。

View File

@@ -7,53 +7,46 @@
{
public static class Types
{
public class Address
public class AddressDetail
{
public static class Types
{
public class AddressInformation
public class Address
{
/// <summary>
/// 获取或设置联系人姓名。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 获取或设置邮政编码。
/// </summary>
[Newtonsoft.Json.JsonProperty("postal_code")]
[System.Text.Json.Serialization.JsonPropertyName("postal_code")]
public string? PostalCode { get; set; }
public string UserName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置省份。
/// </summary>
[Newtonsoft.Json.JsonProperty("province_name")]
[System.Text.Json.Serialization.JsonPropertyName("province_name")]
public string Province { get; set; } = string.Empty;
public string ProvinceName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置城市。
/// </summary>
[Newtonsoft.Json.JsonProperty("city_name")]
[System.Text.Json.Serialization.JsonPropertyName("city_name")]
public string City { get; set; } = string.Empty;
public string CityName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置区县。
/// </summary>
[Newtonsoft.Json.JsonProperty("county_name")]
[System.Text.Json.Serialization.JsonPropertyName("county_name")]
public string District { get; set; } = string.Empty;
public string DistrictName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置详细地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("detail_info")]
[System.Text.Json.Serialization.JsonPropertyName("detail_info")]
public string AddressDetail { get; set; } = string.Empty;
public string Detail { get; set; } = string.Empty;
/// <summary>
/// 获取或设置国家码。
@@ -69,6 +62,20 @@
[System.Text.Json.Serialization.JsonPropertyName("tel_number")]
public string TeleNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置邮政编码。
/// </summary>
[Newtonsoft.Json.JsonProperty("postal_code")]
[System.Text.Json.Serialization.JsonPropertyName("postal_code")]
public string? PostalCode { get; set; }
/// <summary>
/// 获取或设置门牌号。
/// </summary>
[Newtonsoft.Json.JsonProperty("house_number")]
[System.Text.Json.Serialization.JsonPropertyName("house_number")]
public string? HouseNumber { get; set; }
/// <summary>
/// 获取或设置经度。
/// </summary>
@@ -82,13 +89,6 @@
[Newtonsoft.Json.JsonProperty("lat")]
[System.Text.Json.Serialization.JsonPropertyName("lat")]
public double? Latitude { get; set; }
/// <summary>
/// 获取或设置门牌号。
/// </summary>
[Newtonsoft.Json.JsonProperty("house_number")]
[System.Text.Json.Serialization.JsonPropertyName("house_number")]
public string? HouseNumber { get; set; }
}
public class AddressType
@@ -118,7 +118,7 @@
/// </summary>
[Newtonsoft.Json.JsonProperty("address_info")]
[System.Text.Json.Serialization.JsonPropertyName("address_info")]
public Types.AddressInformation AddressInformation { get; set; } = new Types.AddressInformation();
public Types.Address Address { get; set; } = new Types.Address();
/// <summary>
/// 获取或设置地址类型信息。
@@ -180,10 +180,10 @@
}
/// <summary>
/// 获取或设置地址信息。
/// 获取或设置地址详细信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_detail")]
[System.Text.Json.Serialization.JsonPropertyName("address_detail")]
public Types.Address Address { get; set; } = new Types.Address();
public Types.AddressDetail AddressDetail { get; set; } = new Types.AddressDetail();
}
}

View File

@@ -7,46 +7,39 @@
{
public static class Types
{
public class Address
public class AddressDetail
{
public static class Types
{
public class AddressDetail
public class Address
{
/// <summary>
/// 获取或设置联系人姓名。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置邮政编码。
/// </summary>
[Newtonsoft.Json.JsonProperty("postal_code")]
[System.Text.Json.Serialization.JsonPropertyName("postal_code")]
public string? PostalCode { get; set; }
public string UserName { get; set; } = default!;
/// <summary>
/// 获取或设置省份。
/// </summary>
[Newtonsoft.Json.JsonProperty("province_name")]
[System.Text.Json.Serialization.JsonPropertyName("province_name")]
public string Province { get; set; } = default!;
public string ProvinceName { get; set; } = default!;
/// <summary>
/// 获取或设置城市。
/// </summary>
[Newtonsoft.Json.JsonProperty("city_name")]
[System.Text.Json.Serialization.JsonPropertyName("city_name")]
public string City { get; set; } = default!;
public string CityName { get; set; } = default!;
/// <summary>
/// 获取或设置区县。
/// </summary>
[Newtonsoft.Json.JsonProperty("county_name")]
[System.Text.Json.Serialization.JsonPropertyName("county_name")]
public string District { get; set; } = default!;
public string DistrictName { get; set; } = default!;
/// <summary>
/// 获取或设置详细地址。
@@ -69,6 +62,20 @@
[System.Text.Json.Serialization.JsonPropertyName("tel_number")]
public string? TeleNumber { get; set; }
/// <summary>
/// 获取或设置邮政编码。
/// </summary>
[Newtonsoft.Json.JsonProperty("postal_code")]
[System.Text.Json.Serialization.JsonPropertyName("postal_code")]
public string? PostalCode { get; set; }
/// <summary>
/// 获取或设置门牌号。
/// </summary>
[Newtonsoft.Json.JsonProperty("house_number")]
[System.Text.Json.Serialization.JsonPropertyName("house_number")]
public string? HouseNumber { get; set; }
/// <summary>
/// 获取或设置经度。
/// </summary>
@@ -82,13 +89,6 @@
[Newtonsoft.Json.JsonProperty("lat")]
[System.Text.Json.Serialization.JsonPropertyName("lat")]
public double? Latitude { get; set; }
/// <summary>
/// 获取或设置门牌号。
/// </summary>
[Newtonsoft.Json.JsonProperty("house_number")]
[System.Text.Json.Serialization.JsonPropertyName("house_number")]
public string? HouseNumber { get; set; }
}
public class AddressType
@@ -121,11 +121,11 @@
public int AddressId { get; set; }
/// <summary>
/// 获取或设置地址详细信息。
/// 获取或设置地址信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_info")]
[System.Text.Json.Serialization.JsonPropertyName("address_info")]
public Types.AddressDetail AddressDetail { get; set; } = default!;
public Types.Address Address { get; set; } = default!;
/// <summary>
/// 获取或设置地址类型信息。
@@ -205,6 +205,6 @@
/// </summary>
[Newtonsoft.Json.JsonProperty("address_list")]
[System.Text.Json.Serialization.JsonPropertyName("address_list")]
public Types.Address[] AddressList { get; set; } = default!;
public Types.AddressDetail[] AddressDetailList { get; set; } = default!;
}
}

View File

@@ -7,7 +7,7 @@
{
public static class Types
{
public class Address : ProductAddressAddRequest.Types.Address
public class AddressDetail : ProductAddressAddRequest.Types.AddressDetail
{
/// <summary>
/// 获取或设置地址 ID。
@@ -19,10 +19,10 @@
}
/// <summary>
/// 获取或设置地址信息。
/// 获取或设置地址详细信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_detail")]
[System.Text.Json.Serialization.JsonPropertyName("address_detail")]
public Types.Address Address { get; set; } = new Types.Address();
public Types.AddressDetail AddressDetail { get; set; } = new Types.AddressDetail();
}
}

View File

@@ -18,21 +18,21 @@
/// </summary>
[Newtonsoft.Json.JsonProperty("province_name")]
[System.Text.Json.Serialization.JsonPropertyName("province_name")]
public string? Province { get; set; }
public string? ProvinceName { get; set; }
/// <summary>
/// 获取或设置城市。
/// </summary>
[Newtonsoft.Json.JsonProperty("city_name")]
[System.Text.Json.Serialization.JsonPropertyName("city_name")]
public string? City { get; set; }
public string? CityName { get; set; }
/// <summary>
/// 获取或设置区县。
/// </summary>
[Newtonsoft.Json.JsonProperty("county_name")]
[System.Text.Json.Serialization.JsonPropertyName("county_name")]
public string? District { get; set; }
public string? DistrictName { get; set; }
}
public class Area

View File

@@ -20,21 +20,21 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("province_name")]
[System.Text.Json.Serialization.JsonPropertyName("province_name")]
public string? Province { get; set; }
public string? ProvinceName { get; set; }
/// <summary>
/// 获取或设置城市。
/// </summary>
[Newtonsoft.Json.JsonProperty("city_name")]
[System.Text.Json.Serialization.JsonPropertyName("city_name")]
public string? City { get; set; }
public string? CityName { get; set; }
/// <summary>
/// 获取或设置区县。
/// </summary>
[Newtonsoft.Json.JsonProperty("county_name")]
[System.Text.Json.Serialization.JsonPropertyName("county_name")]
public string? District { get; set; }
public string? DistrictName { get; set; }
}
public class Area

View File

@@ -191,7 +191,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
public string WaybillId { get; set; } = default!;
}
public class Address : ProductAddressGetResponse.Types.Address.Types.AddressDetail
public class Address : ProductAddressGetResponse.Types.AddressDetail.Types.Address
{
}

View File

@@ -44,7 +44,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
public static class Types
{
public class Address : ProductAddressAddRequest.Types.Address.Types.AddressInformation
public class Address : ProductAddressAddRequest.Types.AddressDetail.Types.Address
{
}
}

View File

@@ -35,7 +35,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("contact_name")]
[System.Text.Json.Serialization.JsonPropertyName("contact_name")]
public string Name { get; set; } = default!;
public string UserName { get; set; } = default!;
/// <summary>
/// 获取或设置联系人身份证号。

View File

@@ -128,7 +128,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("contact_name")]
[System.Text.Json.Serialization.JsonPropertyName("contact_name")]
public string Name { get; set; } = default!;
public string UserName { get; set; } = default!;
/// <summary>
/// 获取或设置联系人身份证号。

View File

@@ -0,0 +1,26 @@
{
"address_detail": {
"address_info": {
"user_name": "xasdss",
"postal_code": "510983",
"province_name": "广东省",
"city_name": "广州市",
"county_name": "天河区",
"detail_info": "广州市天河区****",
"tel_number": "18666666666",
"lat": 23.12463,
"lng": 113.36199,
"house_number": "111222"
},
"landline": "",
"remark": "",
"send_addr": false,
"default_send": false,
"recv_addr": false,
"default_recv": false,
"address_type": {
"same_city": 0,
"pickup": 0
}
}
}

View File

@@ -0,0 +1,31 @@
{
"errcode": 0,
"errmsg": "",
"address_detail": {
"address_id": 12345,
"address_info": {
"user_name": "xasdss",
"postal_code": "510983",
"province_name": "广东省",
"city_name": "广州市",
"county_name": "天河区",
"detail_info": "广州市天河区****",
"tel_number": "18666666666",
"lat": 23.12463,
"lng": 113.36199,
"house_number": "111222"
},
"landline": "",
"remark": "",
"send_addr": 0,
"default_send": 1,
"recv_addr": 0,
"default_recv": 1,
"create_time": 1662480000,
"update_time": 1662480000,
"address_type": {
"same_city": 0,
"pickup": 0
}
}
}

View File

@@ -0,0 +1,3 @@
{
"address_id_list": ["111222", "222333"]
}

View File

@@ -0,0 +1,27 @@
{
"address_detail": {
"address_id": "12345",
"address_info": {
"user_name": "xasdss",
"postal_code": "510983",
"province_name": "广东省",
"city_name": "广州市",
"county_name": "天河区",
"detail_info": "广州市天河区****",
"tel_number": "18666666666",
"lat": 23.12463,
"lng": 113.36199,
"house_number": "12"
},
"landline": "",
"remark": "",
"send_addr": 0,
"default_send": 1,
"recv_addr": 0,
"default_recv": 1,
"address_type": {
"same_city": 0,
"pickup": 0
}
}
}