mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-19 07:44:46 +08:00
feat(wxapi): 调整部分文档注释
This commit is contained in:
parent
737095305f
commit
2e294b0ce7
@ -7,7 +7,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
|||||||
/// <para>表示 EVENT.unsubscribe 事件的数据。</para>
|
/// <para>表示 EVENT.unsubscribe 事件的数据。</para>
|
||||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_event_pushes.html#%E5%85%B3%E6%B3%A8-%E5%8F%96%E6%B6%88%E5%85%B3%E6%B3%A8%E4%BA%8B%E4%BB%B6 </para>
|
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_event_pushes.html#%E5%85%B3%E6%B3%A8-%E5%8F%96%E6%B6%88%E5%85%B3%E6%B3%A8%E4%BA%8B%E4%BB%B6 </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UnsubscribePushEvent : WechatApiEvent, WechatApiEvent.Types.IXmlSerializable
|
public class UnsubscribePushEvent : SubscribePushEvent, WechatApiEvent.Types.IXmlSerializable
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
if (string.IsNullOrEmpty(request.DeliverySignature))
|
if (string.IsNullOrEmpty(request.DeliverySignature))
|
||||||
{
|
{
|
||||||
string plainText = $"{request.ShopId}{request.ShopOrderId}{client.ImmeDeliveryAppSecret}";
|
string plainText = $"{request.ShopId}{request.ShopOrderId}{client.ImmeDeliveryAppSecret}";
|
||||||
request.DeliverySignature = Utilities.Sha1Util.Hash(plainText).ToLower();
|
request.DeliverySignature = Security.SHA1Utility.Hash(plainText).ToLower();
|
||||||
}
|
}
|
||||||
|
|
||||||
return request;
|
return request;
|
||||||
|
@ -47,7 +47,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
+ $"&org_loc={reqLoc}"
|
+ $"&org_loc={reqLoc}"
|
||||||
+ $"&method={method.ToUpper()}"
|
+ $"&method={method.ToUpper()}"
|
||||||
+ $"&secret={client.MidasAppKey}";
|
+ $"&secret={client.MidasAppKey}";
|
||||||
request.Signature = Utilities.HmacSha256Util.Hash(client.MidasAppKey ?? string.Empty, plainText).ToLower();
|
request.Signature = Security.HMACSHA256Utility.Hash(client.MidasAppKey ?? string.Empty, plainText).ToLower();
|
||||||
}
|
}
|
||||||
|
|
||||||
return request;
|
return request;
|
||||||
|
@ -18,7 +18,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
public static class WechatApiClientParameterExtensions
|
public static class WechatApiClientParameterExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>生成客户端 JS-SDK 初始化所需的参数。</para>
|
/// <para>生成客户端 JS-SDK `wx.config` 所需的参数。</para>
|
||||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#62 </para>
|
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#62 </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="client"></param>
|
/// <param name="client"></param>
|
||||||
@ -33,7 +33,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
|
|
||||||
string timestamp = DateTimeOffset.Now.ToLocalTime().ToUnixTimeSeconds().ToString();
|
string timestamp = DateTimeOffset.Now.ToLocalTime().ToUnixTimeSeconds().ToString();
|
||||||
string nonce = Guid.NewGuid().ToString("N");
|
string nonce = Guid.NewGuid().ToString("N");
|
||||||
string sign = Utilities.Sha1Util.Hash($"jsapi_ticket={jsapiTicket}&noncestr={nonce}×tamp={timestamp}&url={url.Split('#')[0]}").ToLower();
|
string sign = Security.SHA1Utility.Hash($"jsapi_ticket={jsapiTicket}&noncestr={nonce}×tamp={timestamp}&url={url.Split('#')[0]}").ToLower();
|
||||||
|
|
||||||
return new ReadOnlyDictionary<string, string>(new Dictionary<string, string>()
|
return new ReadOnlyDictionary<string, string>(new Dictionary<string, string>()
|
||||||
{
|
{
|
||||||
@ -66,7 +66,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
sortedParams.Add(client.AppId);
|
sortedParams.Add(client.AppId);
|
||||||
sortedParams.Add(nonce);
|
sortedParams.Add(nonce);
|
||||||
sortedParams.Add(wxcardTicket);
|
sortedParams.Add(wxcardTicket);
|
||||||
string cardSign = Utilities.Sha1Util.Hash(string.Join(string.Empty, sortedParams)).ToLower();
|
string cardSign = Security.SHA1Utility.Hash(string.Join(string.Empty, sortedParams)).ToLower();
|
||||||
|
|
||||||
return new ReadOnlyDictionary<string, string>(new Dictionary<string, string>()
|
return new ReadOnlyDictionary<string, string>(new Dictionary<string, string>()
|
||||||
{
|
{
|
||||||
|
@ -87,7 +87,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置二维码有效时间(单位:秒)。
|
/// 获取或设置二维码有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
||||||
|
@ -9,7 +9,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public class CardQrcodeCreateResponse : WechatApiResponse
|
public class CardQrcodeCreateResponse : WechatApiResponse
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置二维码有效时间(单位:秒)。
|
/// 获取或设置二维码有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
||||||
|
@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public string PdfUrl { get; set; } = default!;
|
public string PdfUrl { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置发票文件 URL 有效时间(单位:秒)。
|
/// 获取或设置发票文件 URL 有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("pdf_url_expire_time")]
|
[Newtonsoft.Json.JsonProperty("pdf_url_expire_time")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("pdf_url_expire_time")]
|
[System.Text.Json.Serialization.JsonPropertyName("pdf_url_expire_time")]
|
||||||
|
@ -9,14 +9,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public class CgibinTicketGetTicketResponse : WechatApiResponse
|
public class CgibinTicketGetTicketResponse : WechatApiResponse
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置 ApiTicket,即卡券接口中签名所需凭证。
|
/// 获取或设置票据。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("ticket")]
|
[Newtonsoft.Json.JsonProperty("ticket")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("ticket")]
|
[System.Text.Json.Serialization.JsonPropertyName("ticket")]
|
||||||
public string Ticket { get; set; } = default!;
|
public string Ticket { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置凭证有效时间(单位:秒)。
|
/// 获取或设置票据有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||||
|
@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public string AccessToken { get; set; } = default!;
|
public string AccessToken { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置凭证有效时间(单位:秒)。
|
/// 获取或设置凭证有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||||
|
@ -23,7 +23,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public string? AuthorizerRefreshToken { get; set; }
|
public string? AuthorizerRefreshToken { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置授权方 AccessToken 有效时间(单位:秒)。
|
/// 获取或设置授权方 AccessToken 有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||||
|
@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public string ComponentAccessToken { get; set; } = default!;
|
public string ComponentAccessToken { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置第三方平台 AccessToken 有效时间(单位:秒)。
|
/// 获取或设置第三方平台 AccessToken 有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||||
|
@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public string PreAuthCode { get; set; } = default!;
|
public string PreAuthCode { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置预授权码有效时间(单位:秒)。
|
/// 获取或设置预授权码有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||||
|
@ -60,7 +60,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public string? AuthorizerRefreshToken { get; set; }
|
public string? AuthorizerRefreshToken { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置授权方 AccessToken 有效时间(单位:秒)。
|
/// 获取或设置授权方 AccessToken 有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||||
|
@ -42,7 +42,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置二维码有效时间(单位:秒)。
|
/// 获取或设置二维码有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
||||||
|
@ -9,7 +9,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public class CgibinQrcodeCreateResponse : WechatApiResponse
|
public class CgibinQrcodeCreateResponse : WechatApiResponse
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置二维码有效时间(单位:秒)。
|
/// 获取或设置二维码有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
||||||
|
@ -9,7 +9,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public class CgibinShortenFetchResponse : WechatApiResponse
|
public class CgibinShortenFetchResponse : WechatApiResponse
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置二维码类型有效时间(单位:秒)。
|
/// 获取或设置二维码类型有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
||||||
|
@ -9,7 +9,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public class CgibinShortenGenerateRequest : WechatApiRequest
|
public class CgibinShortenGenerateRequest : WechatApiRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置有效时间(单位:秒)。
|
/// 获取或设置有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
[Newtonsoft.Json.JsonProperty("expire_seconds")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
[System.Text.Json.Serialization.JsonPropertyName("expire_seconds")]
|
||||||
|
@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public string AuthUrl { get; set; } = default!;
|
public string AuthUrl { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置授权链接有效时间(单位:秒)。
|
/// 获取或设置授权链接有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||||
|
@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public string AuthUrl { get; set; } = default!;
|
public string AuthUrl { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置授权链接有效时间(单位:秒)。
|
/// 获取或设置授权链接有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expire_time")]
|
[Newtonsoft.Json.JsonProperty("expire_time")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
|
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
|
||||||
|
@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
|||||||
public string AccessToken { get; set; } = default!;
|
public string AccessToken { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置凭证有效时间(单位:秒)。
|
/// 获取或设置凭证有效期(单位:秒)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||||
|
@ -55,7 +55,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
public string? Event { get; set; }
|
public string? Event { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置消息创建时间。
|
/// 获取或设置消息创建时间戳。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("CreateTime")]
|
[Newtonsoft.Json.JsonProperty("CreateTime")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("CreateTime")]
|
[System.Text.Json.Serialization.JsonPropertyName("CreateTime")]
|
||||||
|
Loading…
Reference in New Issue
Block a user