fix(tenpayv3): 修复代码分析工具检测出的 API 定义问题

This commit is contained in:
Fu Diwei
2021-06-10 15:43:55 +08:00
parent 7f9dfaa932
commit 320b9177db
16 changed files with 31 additions and 23 deletions

View File

@@ -11,8 +11,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? SubMerchantId { get; set; }
/// <summary>

View File

@@ -22,6 +22,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// 获取或设置场景类型。
/// <para>默认值Wap</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]

View File

@@ -17,6 +17,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// <summary>
/// 获取或设置资金账户类型。
/// <para>默认值ALL</para>
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]

View File

@@ -28,10 +28,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// <summary>
/// 获取或设置退款币种。
/// <para>默认值CNY</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("currency")]
[System.Text.Json.Serialization.JsonPropertyName("currency")]
public string Currency { get; set; } = default!;
public string Currency { get; set; } = "CNY";
}
}

View File

@@ -17,6 +17,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// <summary>
/// 获取或设置资金账户类型。
/// <para>默认值NO_SUCC</para>
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]

View File

@@ -11,8 +11,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
}
}

View File

@@ -11,8 +11,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
}
}

View File

@@ -13,6 +13,6 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("apply_permissions_token")]
[System.Text.Json.Serialization.JsonPropertyName("apply_permissions_token")]
public string ApplyPermissionsToken { get; set; } = string.Empty;
public string ApplyPermissionsToken { get; set; } = default!;
}
}

View File

@@ -60,6 +60,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// <summary>
/// 获取或设置场景类型。
/// <para>默认值Order_Paid</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]

View File

@@ -21,6 +21,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// <summary>
/// 获取或设置币种。
/// <para>默认值CNY</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("currency")]
[System.Text.Json.Serialization.JsonPropertyName("currency")]

View File

@@ -26,6 +26,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// 获取或设置场景类型。
/// <para>默认值Wap</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]

View File

@@ -48,6 +48,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// <summary>
/// 获取或设置退款币种。
/// <para>默认值CNY</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("currency")]
[System.Text.Json.Serialization.JsonPropertyName("currency")]

View File

@@ -48,6 +48,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// <summary>
/// 获取或设置退款币种。
/// <para>默认值CNY</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("currency")]
[System.Text.Json.Serialization.JsonPropertyName("currency")]

View File

@@ -9,31 +9,31 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
public class WechatTenpayClientOptions
{
/// <summary>
/// <para>获取或设置请求超时时间(单位:毫秒)。</para>
/// 获取或设置请求超时时间(单位:毫秒)。
/// <para>默认值30000</para>
/// </summary>
public int Timeout { get; set; } = 30 * 1000;
/// <summary>
/// <para>获取或设置微信支付 API 域名。</para>
/// 获取或设置微信支付 API 域名。
/// <para>默认值:<see cref="WechatTenpayEndpoints.DEFAULT"/></para>
/// </summary>
public string? Endpoints { get; set; } = WechatTenpayEndpoints.DEFAULT;
/// <summary>
/// <para>获取或设置声明应答中的错误描述使用的自然语言语种。</para>
/// 获取或设置声明应答中的错误描述使用的自然语言语种。
/// <para>默认值:<i>根据操作系统自动生成</i></para>
/// </summary>
public string UserAgent { get; set; } = $"OS/{Environment.OSVersion.Platform} SKIT.FlurlHttpClient.Wechat.Tenpay/{Assembly.GetExecutingAssembly().GetName().Version}";
/// <summary>
/// <para>获取或设置声明应答中的错误描述使用的自然语言语种。</para>
/// 获取或设置声明应答中的错误描述使用的自然语言语种。
/// <para>默认值zh_CN</para>
/// </summary>
public string AcceptLanguage { get; set; } = "zh-CN";
/// <summary>
/// <para>获取或设置微信支付 API 签名认证方式。</para>
/// 获取或设置微信支付 API 签名认证方式。
/// <para>默认值:<see cref="WechatTenpayAuthSchemes.WECHATPAY2_SHA256_RSA2048"/></para>
/// </summary>
public string AuthScheme { get; set; } = WechatTenpayAuthSchemes.WECHATPAY2_SHA256_RSA2048;

View File

@@ -8,15 +8,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
public abstract class WechatTenpayRequest : IWechatRequest
{
/// <summary>
/// <para>获取或设置请求超时时间(单位:毫秒)。</para>
/// <para>如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.Timeout"/> 参数,这在需要指定特定耗时请求(比如上传或下载文件)的超时时间时很有用。</para>
/// 获取或设置请求超时时间(单位:毫秒)。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.Timeout"/> 参数,这在需要指定特定耗时请求(比如上传或下载文件)的超时时间时很有用。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public virtual int? Timeout { get; set; }
/// <summary>
/// <para>获取或设置微信请求使用的微信支付平台证书序列号。</para>
/// 获取或设置微信请求使用的微信支付平台证书序列号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]