mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 23:13:32 +08:00
feat(wxapi): 新增小程序联盟自定义用户参数管理相关接口
This commit is contained in:
parent
2d53008dc3
commit
2b2a4b4e59
@ -314,5 +314,108 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendRequestWithJsonAsync<Models.UnionPromoterTargetApplyStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region OpenAccount
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /union/promoter/open_account/bind 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/access-guidelines/promoter/api/customized-userinfo.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.UnionPromoterOpenAccountBindResponse> ExecuteUnionPromoterOpenAccountBindAsync(this WechatApiClient client, Models.UnionPromoterOpenAccountBindRequest 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, "union", "promoter", "open_account", "bind")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.UnionPromoterOpenAccountBindResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /union/promoter/open_account/get 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/access-guidelines/promoter/api/customized-userinfo.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.UnionPromoterOpenAccountGetResponse> ExecuteUnionPromoterOpenAccountGetAsync(this WechatApiClient client, Models.UnionPromoterOpenAccountGetRequest 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.Get, "union", "promoter", "open_account", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.UnionPromoterOpenAccountGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /union/promoter/open_account/add_customize_info 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/access-guidelines/promoter/api/customized-userinfo.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.UnionPromoterOpenAccountAddCustomizeInfoResponse> ExecuteUnionPromoterOpenAccountAddCustomizeInfoAsync(this WechatApiClient client, Models.UnionPromoterOpenAccountAddCustomizeInfoRequest 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, "union", "promoter", "open_account", "add_customize_info")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.UnionPromoterOpenAccountAddCustomizeInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /union/promoter/open_account/del_customize_info 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/access-guidelines/promoter/api/customized-userinfo.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.UnionPromoterOpenAccountDeleteCustomizeInfoResponse> ExecuteUnionPromoterOpenAccountDeleteCustomizeInfoAsync(this WechatApiClient client, Models.UnionPromoterOpenAccountDeleteCustomizeInfoRequest 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, "union", "promoter", "open_account", "del_customize_info")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.UnionPromoterOpenAccountDeleteCustomizeInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /union/promoter/open_account/get_customize_info 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/access-guidelines/promoter/api/customized-userinfo.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.UnionPromoterOpenAccountGetCustomizeInfoResponse> ExecuteUnionPromoterOpenAccountGetCustomizeInfoAsync(this WechatApiClient client, Models.UnionPromoterOpenAccountGetCustomizeInfoRequest 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.Get, "union", "promoter", "open_account", "get_customize_info")
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("unionid", request.UnionId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.UnionPromoterOpenAccountGetCustomizeInfoResponse>(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] /union/promoter/open_account/add_customize_info 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class UnionPromoterOpenAccountAddCustomizeInfoRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置开放平台 UnionID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unionid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unionid")]
|
||||
public string UnionId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置自定义参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("customizeInfo")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("customizeInfo")]
|
||||
public string CustomizeInfo { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /union/promoter/open_account/add_customize_info 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class UnionPromoterOpenAccountAddCustomizeInfoResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /union/promoter/open_account/bind 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class UnionPromoterOpenAccountBindRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置开放平台账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openAccount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openAccount")]
|
||||
public string OpenAccount { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /union/promoter/open_account/bind 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class UnionPromoterOpenAccountBindResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /union/promoter/open_account/del_customize_info 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class UnionPromoterOpenAccountDeleteCustomizeInfoRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置开放平台 UnionID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unionid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unionid")]
|
||||
public string UnionId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /union/promoter/open_account/del_customize_info 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class UnionPromoterOpenAccountDeleteCustomizeInfoResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /union/promoter/open_account/get_customize_info 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class UnionPromoterOpenAccountGetCustomizeInfoRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置开放平台 UnionID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string UnionId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /union/promoter/open_account/get_customize_info 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class UnionPromoterOpenAccountGetCustomizeInfoResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置自定义参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("customizeInfo")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("customizeInfo")]
|
||||
public string CustomizeInfo { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /union/promoter/open_account/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class UnionPromoterOpenAccountGetRequest : WechatApiRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /union/promoter/open_account/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class UnionPromoterOpenAccountGetResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置开放平台账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openAccount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openAccount")]
|
||||
public string OpenAccount { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -11,8 +11,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
/// <summary>
|
||||
/// 获取或设置定向计划 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("planId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("planId")]
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string PlanId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"unionid": "UNIONID",
|
||||
"customizeInfo": "customizeInfo"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"openAccount": "APPID"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"unionid": "UNIONID"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok"
|
||||
}
|
@ -0,0 +1 @@
|
||||
{}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"customizeInfo": "customizeInfo"
|
||||
}
|
@ -0,0 +1 @@
|
||||
{}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"openAccount": "APPID"
|
||||
}
|
Loading…
Reference in New Issue
Block a user