mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-12-29 09:54:44 +08:00
feat(wxapi): 新增微信小店小店会员相关接口
This commit is contained in:
@@ -7764,6 +7764,98 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECVipWxaInfoGetV3Response>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/vip/user/list/get 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/vip/api_getuserlist.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECVipUserListGetResponse> ExecuteChannelsECVipUserListGetAsync(this WechatApiClient client, Models.ChannelsECVipUserListGetRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "vip", "user", "list", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECVipUserListGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/vip/user/info/get 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/vip/api_getuserinfo.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECVipUserInfoGetResponse> ExecuteChannelsECVipUserInfoGetAsync(this WechatApiClient client, Models.ChannelsECVipUserInfoGetRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "vip", "user", "info", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECVipUserInfoGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/vip/user/score/get 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/vip/api_getvipuserscore.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECVipUserScoreGetResponse> ExecuteChannelsECVipUserScoreGetAsync(this WechatApiClient client, Models.ChannelsECVipUserScoreGetRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "vip", "user", "score", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECVipUserScoreGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/vip/user/score/flowrecord/get 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/vip/api_getuserscoreflowrecord.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECVipUserScoreFlowRecordGetResponse> ExecuteChannelsECVipUserScoreFlowRecordGetAsync(this WechatApiClient client, Models.ChannelsECVipUserScoreFlowRecordGetRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "vip", "user", "score", "flowrecord", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECVipUserScoreFlowRecordGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ECVoucher
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/vip/user/info/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECVipUserInfoGetRequest : WechatApiRequest, IInferable<ChannelsECVipUserInfoGetRequest, ChannelsECVipUserInfoGetResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置用户的 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/vip/user/info/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECVipUserInfoGetResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class User : ChannelsECVipUserListGetResponse.Types.User
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("info")]
|
||||
public Types.User User { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/vip/user/list/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECVipUserListGetRequest : WechatApiRequest, IInferable<ChannelsECVipUserListGetRequest, ChannelsECVipUserListGetResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置分页页数。
|
||||
/// <para>默认值:1</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page_num")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page_num")]
|
||||
public int Page { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// <para>默认值:10</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page_size")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page_size")]
|
||||
public int Limit { get; set; } = 10;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/vip/user/list/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECVipUserListGetResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class GradeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置等级。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("grade")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("grade")]
|
||||
public int Grade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置经验值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("experience_value")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("experience_value")]
|
||||
public int ExperienceValue { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户的 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户的 UnionId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unionid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unionid")]
|
||||
public string? UnionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户等级信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user_grade_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_grade_info")]
|
||||
public Types.GradeInfo? GradeInfo { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("list")]
|
||||
public Types.User[] UserList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置总数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total_num")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
|
||||
public int TotalCount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/vip/user/score/flowrecord/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECVipUserScoreFlowRecordGetRequest : WechatApiRequest, IInferable<ChannelsECVipUserScoreFlowRecordGetRequest, ChannelsECVipUserScoreFlowRecordGetResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置用户的 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页页数。
|
||||
/// <para>默认值:1</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page_num")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page_num")]
|
||||
public int Page { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// <para>默认值:10</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page_size")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page_size")]
|
||||
public int Limit { get; set; } = 10;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/vip/user/score/flowrecord/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECVipUserScoreFlowRecordGetResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class FlowRecord
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置积分值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("score")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("score")]
|
||||
public int Score { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置流水来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("source")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("source")]
|
||||
public int Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置流水记录。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("remark")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置积分流水列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("list")]
|
||||
public Types.FlowRecord[] FlowRecordList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置总数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total_num")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
|
||||
public int TotalCount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/vip/user/score/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECVipUserScoreGetRequest : WechatApiRequest, IInferable<ChannelsECVipUserScoreGetRequest, ChannelsECVipUserScoreGetResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置用户的 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/vip/user/score/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECVipUserScoreGetResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置用户积分。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("score")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberReadOnlyConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("score")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))]
|
||||
public int Score { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置返回数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("info")]
|
||||
public Types.Data Data { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"openid": ""
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"info": {
|
||||
"openid": "OPENID",
|
||||
"user_grade_info": {
|
||||
"grade": 3,
|
||||
"experience_value": 10000
|
||||
},
|
||||
"unionid": "UNIONID"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"page_num": 1,
|
||||
"page_size": 10
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"list": [
|
||||
{
|
||||
"openid": "OPENID",
|
||||
"user_grade_info": {
|
||||
"grade": 3,
|
||||
"experience_value": 1000
|
||||
},
|
||||
"unionid": "UNIONID"
|
||||
}
|
||||
],
|
||||
"total_num": 1230
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"openid": "OPENID",
|
||||
"page_num": 1,
|
||||
"page_size": 10
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"list": [
|
||||
{
|
||||
"score": 10,
|
||||
"source": 2,
|
||||
"remark": "下单-增加积分"
|
||||
},
|
||||
{
|
||||
"score": -6,
|
||||
"source": 5,
|
||||
"remark": "下单-抵扣积分"
|
||||
}
|
||||
],
|
||||
"total_num": 1000
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"openid": "OPENID"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"info": {
|
||||
"score": "100"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user