mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(wxapi): 新增代商家管理小程序获取发布后生效域名列表接口
This commit is contained in:
parent
99ddcfaefb
commit
0bb1e9bda6
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -172,6 +172,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaSetWebviewDomainResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/setwebviewdomain_directly 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/domain-management/modifyJumpDomainDirectly.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaSetWebviewDomainDirectlyResponse> ExecuteWxaSetWebviewDomainDirectlyAsync(this WechatApiClient client, Models.WxaSetWebviewDomainDirectlyRequest 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, "wxa", "setwebviewdomain_directly")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaSetWebviewDomainDirectlyResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/get_webviewdomain_confirmfile 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/domain-management/getJumpDomainConfirmFile.html </para>
|
||||
@ -191,6 +211,46 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaGetWebviewDomainConfirmFileResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/get_effective_domain 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/domain-management/getEffectiveServerDomain.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaGetEffectiveDomainResponse> ExecuteWxaGetEffectiveDomainAsync(this WechatApiClient client, Models.WxaGetEffectiveDomainRequest 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, "wxa", "get_effective_domain")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaGetEffectiveDomainResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /wxa/get_effective_webviewdomain 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/domain-management/getEffectiveJumpDomain.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.WxaGetEffectiveWebviewDomainResponse> ExecuteWxaGetEffectiveWebviewDomainAsync(this WechatApiClient client, Models.WxaGetEffectiveWebviewDomainRequest 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, "wxa", "get_effective_webviewdomain")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.WxaGetEffectiveWebviewDomainResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Register
|
||||
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/get_effective_domain 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class WxaGetEffectiveDomainRequest : WechatApiRequest, IInferable<WxaGetEffectiveDomainRequest, WxaGetEffectiveDomainResponse>
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/get_effective_domain 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class WxaGetEffectiveDomainResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 Request 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("requestdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("requestdomain")]
|
||||
public string[] RequestDomainList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 Socket 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wsrequestdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wsrequestdomain")]
|
||||
public string[] WebSocketDomainList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 UploadFile 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uploaddomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uploaddomain")]
|
||||
public string[] UploadDomainList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 DownloadFile 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("downloaddomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("downloaddomain")]
|
||||
public string[] DownloadDomainList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 UDP 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("udpdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("udpdomain")]
|
||||
public string[] UdpDomainList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 TCP 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tcpdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tcpdomain")]
|
||||
public string[] TcpDomainList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置通过公众平台配置的服务器域名信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mp_domain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mp_domain")]
|
||||
public Types.Domain? MpDomain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置通过第三方平台接口配置的服务器域名信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("third_domain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("third_domain")]
|
||||
public Types.Domain? ThirdDomain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置通过 ModifyServerDomainDirectly 接口配置的服务器域名信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("direct_domain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("direct_domain")]
|
||||
public Types.Domain? DirectlyDomain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置最后提交代码或者发布上线后生效的域名信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("effective_domain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("effective_domain")]
|
||||
public Types.Domain? EffectiveDomain { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/get_effective_webviewdomain 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class WxaGetEffectiveWebviewDomainRequest : WechatApiRequest, IInferable<WxaGetEffectiveWebviewDomainRequest, WxaGetEffectiveWebviewDomainResponse>
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/get_effective_webviewdomain 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class WxaGetEffectiveWebviewDomainResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 Request 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("requestdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("requestdomain")]
|
||||
public string[] RequestDomainList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 Socket 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wsrequestdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wsrequestdomain")]
|
||||
public string[] WebSocketDomainList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 UploadFile 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("uploaddomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("uploaddomain")]
|
||||
public string[] UploadDomainList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 DownloadFile 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("downloaddomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("downloaddomain")]
|
||||
public string[] DownloadDomainList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 UDP 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("udpdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("udpdomain")]
|
||||
public string[] UdpDomainList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 TCP 合法域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tcpdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tcpdomain")]
|
||||
public string[] TcpDomainList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置通过公众平台配置的 Webview 域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mp_webviewdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mp_webviewdomain")]
|
||||
public string[]? MpWebviewDomain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置通过第三方平台接口配置的 Webview 域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("third_webviewdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("third_webviewdomain")]
|
||||
public string[]? ThirdWebviewDomain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置通过 ModifyServerDomainDirectly 接口配置的 Webview 域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("direct_webviewdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("direct_webviewdomain")]
|
||||
public string[]? DirectlyWebviewDomain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置最后提交代码或者发布上线后生效的 Webview 域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("effective_webviewdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("effective_webviewdomain")]
|
||||
public string[]? EffectiveWebviewDomain { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/setwebviewdomain_directly 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class WxaSetWebviewDomainDirectlyRequest : WechatApiRequest, IInferable<WxaSetWebviewDomainDirectlyRequest, WxaSetWebviewDomainDirectlyResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置操作类型。
|
||||
/// <para>默认值:get</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("action")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("action")]
|
||||
public string Action { get; set; } = "get";
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("webviewdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("webviewdomain")]
|
||||
public IList<string>? WebviewDomainList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /wxa/setwebviewdomain_directly 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class WxaSetWebviewDomainDirectlyResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置业务域名列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("webviewdomain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("webviewdomain")]
|
||||
public string[]? WebviewDomainList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"mp_domain": {
|
||||
"requestdomain": [
|
||||
"https://melody1.qq.com"
|
||||
],
|
||||
"wsrequestdomain": [
|
||||
"wss://melody2.qq.com"
|
||||
],
|
||||
"uploaddomain": [
|
||||
"https://melody3.qq.com"
|
||||
],
|
||||
"downloaddomain": [
|
||||
"https://melody4.qq.com"
|
||||
],
|
||||
"udpdomain": [
|
||||
"udp://melody2.weixin.qq.com",
|
||||
"udp://melody5.weixin.qq.com"
|
||||
],
|
||||
"tcpdomain": [
|
||||
"tcp://melody2.weixin.qq.com",
|
||||
"tcp://melody6.weixin.qq.com"
|
||||
]
|
||||
},
|
||||
"third_domain": {
|
||||
"requestdomain": [
|
||||
"https://melody1.qq.com"
|
||||
],
|
||||
"wsrequestdomain": [
|
||||
"wss://melody2.qq.com"
|
||||
],
|
||||
"uploaddomain": [
|
||||
"https://melody3.qq.com"
|
||||
],
|
||||
"downloaddomain": [
|
||||
"https://melody4.qq.com"
|
||||
],
|
||||
"udpdomain": [
|
||||
"udp://melody2.weixin.qq.com",
|
||||
"udp://melody5.weixin.qq.com"
|
||||
],
|
||||
"tcpdomain": [
|
||||
"tcp://melody2.weixin.qq.com",
|
||||
"tcp://melody6.weixin.qq.com"
|
||||
]
|
||||
},
|
||||
"direct_domain": {
|
||||
"requestdomain": [
|
||||
"https://melody1.qq.com"
|
||||
],
|
||||
"wsrequestdomain": [
|
||||
"wss://melody2.qq.com"
|
||||
],
|
||||
"uploaddomain": [
|
||||
"https://melody3.qq.com"
|
||||
],
|
||||
"downloaddomain": [
|
||||
"https://melody4.qq.com"
|
||||
],
|
||||
"udpdomain": [
|
||||
"udp://melody5.weixin.qq.com"
|
||||
],
|
||||
"tcpdomain": [
|
||||
"tcp://melody6.weixin.qq.com"
|
||||
]
|
||||
},
|
||||
"effective_domain": {
|
||||
"requestdomain": [
|
||||
"https://melody1.qq.com"
|
||||
],
|
||||
"wsrequestdomain": [
|
||||
"wss://melody2.qq.com"
|
||||
],
|
||||
"uploaddomain": [
|
||||
"https://melody3.qq.com"
|
||||
],
|
||||
"downloaddomain": [
|
||||
"https://melody4.qq.com"
|
||||
],
|
||||
"udpdomain": [
|
||||
"udp://melody2.weixin.qq.com",
|
||||
"udp://melody5.weixin.qq.com"
|
||||
],
|
||||
"tcpdomain": [
|
||||
"tcp://melody2.weixin.qq.com",
|
||||
"tcp://melody6.weixin.qq.com"
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"mp_webviewdomain": [
|
||||
"https://a.b.howielu.top",
|
||||
"https://developers.weixin.qq.com",
|
||||
"https://melody2.howielu.top/"
|
||||
],
|
||||
"third_webviewdomain": [
|
||||
"https://a.b.howielu.top",
|
||||
"https://developers.weixin.qq.com",
|
||||
"https://melody2.howielu.top/"
|
||||
],
|
||||
"direct_webviewdomain": [
|
||||
"https://melody2.howielu.top/"
|
||||
],
|
||||
"effective_webviewdomain": [
|
||||
"https://a.b.howielu.top",
|
||||
"https://developers.weixin.qq.com",
|
||||
"https://melody2.howielu.top/"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user