mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-20 02:29:40 +08:00
feat(wxapi): 新增自定义交易组件推广员相关接口
This commit is contained in:
@@ -63,6 +63,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendRequestWithJsonAsync<Models.ShopRegisterApplyResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /shop/register/apply_scene 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/enter/scene_apply.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ShopRegisterApplySceneResponse> ExecuteShopRegisterApplySceneAsync(this WechatApiClient client, Models.ShopRegisterApplySceneRequest 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, "shop", "register", "apply_scene")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ShopRegisterApplySceneResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /shop/register/check 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent2/API/enter/enter_check.html </para>
|
||||
@@ -935,5 +955,27 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendRequestWithJsonAsync<Models.ShopCouponUpdateUserCouponStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Promoter
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /shop/promoter/list 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/promoter/list.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ShopPromoterListResponse> ExecuteShopPromoterListAsync(this WechatApiClient client, Models.ShopPromoterListRequest 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, "shop", "promoter", "list")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ShopPromoterListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /shop/promoter/list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ShopPromoterListRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置分页页数(从 1 开始)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page")]
|
||||
public int Page { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page_size")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page_size")]
|
||||
public int Limit { get; set; } = 10;
|
||||
}
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /shop/promoter/list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ShopPromoterListResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Promoter
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置推广员 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promoter_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promoter_id")]
|
||||
public string PromoterId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置推广员视频号昵称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("finder_nickname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("finder_nickname")]
|
||||
public string FinderNickname { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置推广员列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promoters")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promoters")]
|
||||
public Types.Promoter[] PromoterList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置推广员总数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total_num")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
|
||||
public int TotalCount { get; set; }
|
||||
}
|
||||
}
|
@@ -8,11 +8,5 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
/// </summary>
|
||||
public class ShopRegisterApplyRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置场景 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scene_group_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scene_group_id")]
|
||||
public int SceneGroupId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /shop/register/apply_scene 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ShopRegisterApplySceneRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置场景 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scene_group_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scene_group_id")]
|
||||
public int SceneGroupId { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /shop/register/apply_scene 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ShopRegisterApplySceneResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"page": 1,
|
||||
"page_size": 10
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"total_num": 3,
|
||||
"promoters": [
|
||||
{
|
||||
"finder_nickname": "XXXX",
|
||||
"promoter_id": "a-***************************************po"
|
||||
},
|
||||
{
|
||||
"finder_nickname": "XXXX",
|
||||
"promoter_id": "N1***************************************BE"
|
||||
},
|
||||
{
|
||||
"finder_nickname": "XXXX",
|
||||
"promoter_id": "9Z***************************************Vk"
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,3 +1 @@
|
||||
{
|
||||
"scene_group_id": 1
|
||||
}
|
||||
{}
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"scene_group_id": 1
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok"
|
||||
}
|
Reference in New Issue
Block a user