style: format

This commit is contained in:
Fu Diwei 2022-05-06 20:29:27 +08:00
parent d364c1a354
commit 7e6cfa5ca3
2352 changed files with 3542 additions and 4198 deletions

View File

@ -1,7 +1,14 @@
[*.cs] root = true
# CS1570: XML 注释出现 XML 格式错误 [*]
charset = utf-8
end_of_line = crlf
indent_size = 4
indent_style = space
tab_width = 4
trim_trailing_whitespace = true
insert_final_newline = true
[*.cs]
dotnet_diagnostic.CS1570.severity = none dotnet_diagnostic.CS1570.severity = none
dotnet_diagnostic.CS1591.severity = suggestion
# CS1591: 缺少对公共可见类型或成员的 XML 注释
dotnet_diagnostic.CS1591.severity = suggestion

2
.gitignore vendored
View File

@ -191,4 +191,4 @@ ModelManifest.xml
# Visual Studio temporary files # Visual Studio temporary files
.vs .vs
*.nupkg *.nupkg
.idea .idea

View File

@ -72,7 +72,7 @@
- **变更**:修改反序列化回调通知事件的相关扩展方法 `DeserializeEventFromXml`、`DeserializeEventFromJson`,废弃其指示是否启用安全模式的参数,改为自动判定。 - **变更**:修改反序列化回调通知事件的相关扩展方法 `DeserializeEventFromXml`、`DeserializeEventFromJson`,废弃其指示是否启用安全模式的参数,改为自动判定。
- **变更**:修改序列化回调通知事件的相关扩展方法 `SerializeEventToXml`、`SerializeEventToJson`,调整其指示是否启用安全模式的参数默认值,由 *false* 变为 *true* - **变更**:修改序列化回调通知事件的相关扩展方法 `SerializeEventToXml`、`SerializeEventToJson`,调整其指示是否启用安全模式的参数默认值,由 _false_ 变为 _true_
- **变更**:移除原 `WxBizMsgCryptor` 工具类。 - **变更**:移除原 `WxBizMsgCryptor` 工具类。

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2020-2021 RHQYZ Copyright (c) 2020-2022 RHQYZ
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -8,4 +8,4 @@
> >
> [《微信官方文档 - 开放平台Token 生成说明》](https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Before_Develop/creat_token.html) > [《微信官方文档 - 开放平台Token 生成说明》](https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Before_Develop/creat_token.html)
该部分所需接口已由 [SKIT.FlurlHttpClient.Wechat.Api](../WechatApi/README.md) 模块提供,请开发者自行阅读相关文档。 该部分所需接口已由 [SKIT.FlurlHttpClient.Wechat.Api](../WechatApi/README.md) 模块提供,请开发者自行阅读相关文档。

View File

@ -16,4 +16,4 @@
### 内置拦截器 ### 内置拦截器
本库内置了一个用于请求时自动生成服务商身份令牌(即 AgencyToken的拦截器。 本库内置了一个用于请求时自动生成服务商身份令牌(即 AgencyToken的拦截器。

View File

@ -12,4 +12,4 @@
bool ret = client.VerifyEventSignature( bool ret = client.VerifyEventSignature(
callbackBody: "<xml> 微信回调通知中请求正文 XML 内容 </xml>" callbackBody: "<xml> 微信回调通知中请求正文 XML 内容 </xml>"
); );
``` ```

View File

@ -42,7 +42,7 @@ var paramMap = client.GenerateParametersForJsapiGetBrandPayRequest(request.AppId
- 生成客户端小程序调起领取红包所需的参数字典:`GenerateParametersForJsapiSendBusinessRedPack` - 生成客户端小程序调起领取红包所需的参数字典:`GenerateParametersForJsapiSendBusinessRedPack`
- 生成客户端公众号唤起微信委托代扣的 URL`GenerateParameterizedUrlForMediaPlatformPAPPayEntrustWeb` / `GenerateParameterizedUrlForMediaPlatformPAPPayPartnerEntrustWeb` - 生成客户端公众号唤起微信委托代扣的 URL`GenerateParameterizedUrlForMediaPlatformPAPPayEntrustWeb` / `GenerateParameterizedUrlForMediaPlatformPAPPayPartnerEntrustWeb`
- 生成客户端小程序唤起微信委托代扣页面所需的参数字典:`GenerateParametersForMiniProgramPAPPayEntrust` / `GenerateParametersForMiniProgramPAPPayPartnerEntrust` - 生成客户端小程序唤起微信委托代扣页面所需的参数字典:`GenerateParametersForMiniProgramPAPPayEntrust` / `GenerateParametersForMiniProgramPAPPayPartnerEntrust`

View File

@ -55,7 +55,7 @@ bool ret = client.VerifyEventSignature(
```csharp ```csharp
bool ret = client.VerifyEventSignature(timestamp, nonce, body, signature, serialNumber, out Exception error); bool ret = client.VerifyEventSignature(timestamp, nonce, body, signature, serialNumber, out Exception error);
if (!ret) if (!ret)
{ {
Console.WriteLine(error); Console.WriteLine(error);
Console.WriteLine(error.InnerException); Console.WriteLine(error.InnerException);
@ -66,4 +66,4 @@ if (!ret)
### 通过 `CertificateManager` 管理平台证书信息: ### 通过 `CertificateManager` 管理平台证书信息:
请参阅本文档[《高级技巧 - 如何加密请求中的敏感数据?》](./Advanced_RequestSensitiveDataEncryption.md)下的同名章节。 请参阅本文档[《高级技巧 - 如何加密请求中的敏感数据?》](./Advanced_RequestSensitiveDataEncryption.md)下的同名章节。

View File

@ -15,4 +15,4 @@
```csharp ```csharp
string certificate = "CRT/CER 证书内容"; string certificate = "CRT/CER 证书内容";
string serialNumber = RSAUtility.ExportSerialNumber(certificate); string serialNumber = RSAUtility.ExportSerialNumber(certificate);
``` ```

View File

@ -1088,7 +1088,6 @@
- Query Fund Settlement Details`QueryHKSettlements` - Query Fund Settlement Details`QueryHKSettlements`
- QR Code Payment - QR Code Payment
- Order Placement`CreateHKTransactionMicroPay` / `CreateHKPartnerTransactionMicroPay` - Order Placement`CreateHKTransactionMicroPay` / `CreateHKPartnerTransactionMicroPay`

View File

@ -77,10 +77,10 @@ var response = await client.ExecuteAddProfitSharingReceiverAsync(request);
如果你希望本库在请求前能自动完成这项操作,你可以在构造得到 `WechatApiClient` 对象时指定自动化参数: 如果你希望本库在请求前能自动完成这项操作,你可以在构造得到 `WechatApiClient` 对象时指定自动化参数:
```csharp ```csharp
var options = new WechatTenpayClientOptions() var options = new WechatTenpayClientOptions()
{ {
// 其他配置项略 // 其他配置项略
AutoEncryptRequestSensitiveProperty = true AutoEncryptRequestSensitiveProperty = true
}; };
var client = new WechatTenpayClient(options); var client = new WechatTenpayClient(options);
``` ```
@ -101,10 +101,10 @@ var client = new WechatTenpayClient(options);
```csharp ```csharp
var manager = new InMemoryCertificateManager(); // 为便于后续使用,该对象可使用同一商户号下全局单例的方式声明 var manager = new InMemoryCertificateManager(); // 为便于后续使用,该对象可使用同一商户号下全局单例的方式声明
var options = new WechatTenpayClientOptions() var options = new WechatTenpayClientOptions()
{ {
// 其他配置项略 // 其他配置项略
PlatformCertificateManager = manager PlatformCertificateManager = manager
}; };
var client = new WechatTenpayClient(options); var client = new WechatTenpayClient(options);
``` ```
@ -227,4 +227,4 @@ public class RedisCertificateManager : CertificateManager
return Connection.GetDatabase().KeyDelete(key); return Connection.GetDatabase().KeyDelete(key);
} }
} }
``` ```

View File

@ -41,9 +41,9 @@ string temp = response.CertificateList.First().EncryptCertificate.CipherText; //
如果你希望本库在响应后能自动完成这项操作,你可以在构造得到 `WechatApiClient` 对象时指定自动化参数: 如果你希望本库在响应后能自动完成这项操作,你可以在构造得到 `WechatApiClient` 对象时指定自动化参数:
```csharp ```csharp
var options = new WechatTenpayClientOptions() var options = new WechatTenpayClientOptions()
{ {
AutoDecryptResponseSensitiveProperty = true AutoDecryptResponseSensitiveProperty = true
}; };
var client = new WechatTenpayClient(options); var client = new WechatTenpayClient(options);
``` ```

View File

@ -64,7 +64,7 @@ bool ret = client.VerifyResponseSignature(response);
```csharp ```csharp
bool ret = client.VerifyResponseSignature(response, out Exception error); bool ret = client.VerifyResponseSignature(response, out Exception error);
if (!ret) if (!ret)
{ {
Console.WriteLine(error); Console.WriteLine(error);
Console.WriteLine(error.InnerException); Console.WriteLine(error.InnerException);
@ -75,4 +75,4 @@ if (!ret)
### 通过 `CertificateManager` 管理平台证书信息: ### 通过 `CertificateManager` 管理平台证书信息:
请参阅本文档[《高级技巧 - 如何加密请求中的敏感数据?》](./Advanced_RequestSensitiveDataEncryption.md)下的同名章节。 请参阅本文档[《高级技巧 - 如何加密请求中的敏感数据?》](./Advanced_RequestSensitiveDataEncryption.md)下的同名章节。

View File

@ -249,4 +249,4 @@
</FlavorProperties> </FlavorProperties>
</VisualStudio> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
</Project> </Project>

View File

@ -7,7 +7,7 @@
<add key="TenpayOptions_Merchant_0_CertPrivateKey" value="填写商户证书文件内容" /> <add key="TenpayOptions_Merchant_0_CertPrivateKey" value="填写商户证书文件内容" />
<add key="TenpayOptions_NotifyUrl" value="https://localhost:5001" /> <add key="TenpayOptions_NotifyUrl" value="https://localhost:5001" />
</appSettings> </appSettings>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
@ -88,4 +88,4 @@
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" /> <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers> </compilers>
</system.codedom> </system.codedom>
</configuration> </configuration>

View File

@ -32,4 +32,4 @@
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" /> <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
<package id="System.Text.Encodings.Web" version="6.0.0" targetFramework="net472" /> <package id="System.Text.Encodings.Web" version="6.0.0" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
</packages> </packages>

View File

@ -1,3 +1,3 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("SKIT.FlurlHttpClient.Wechat.Ads.UnitTests")] [assembly: InternalsVisibleTo("SKIT.FlurlHttpClient.Wechat.Ads.UnitTests")]

View File

@ -22,4 +22,4 @@
### 【更新日志】 ### 【更新日志】
[点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。 [点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。

View File

@ -8,17 +8,17 @@ namespace SKIT.FlurlHttpClient.Wechat.Ads
public abstract class WechatAdsResponse : ICommonResponse public abstract class WechatAdsResponse : ICommonResponse
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int ICommonResponse.RawStatus { get; set; } int ICommonResponse.RawStatus { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!; IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
byte[] ICommonResponse.RawBytes { get; set; } = default!; byte[] ICommonResponse.RawBytes { get; set; } = default!;

View File

@ -1,6 +1,4 @@
using System.Collections.Generic; namespace SKIT.FlurlHttpClient.Wechat.Api.Models
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{ {
/// <summary> /// <summary>
/// <para>表示 [POST] /cgi-bin/express/delivery/open_msg/open_openmsg 接口的请求。</para> /// <para>表示 [POST] /cgi-bin/express/delivery/open_msg/open_openmsg 接口的请求。</para>

View File

@ -1,6 +1,4 @@
using System.Collections.Generic; namespace SKIT.FlurlHttpClient.Wechat.Api.Models
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{ {
/// <summary> /// <summary>
/// <para>表示 [POST] /cgi-bin/express/delivery/open_msg/open_query_plugin 接口的请求。</para> /// <para>表示 [POST] /cgi-bin/express/delivery/open_msg/open_query_plugin 接口的请求。</para>

View File

@ -15,6 +15,7 @@
{ {
public static class Types public static class Types
{ {
[System.Obsolete]
public class Article : CgibinMaterialGetMaterialAsNewsResponse.Types.Article public class Article : CgibinMaterialGetMaterialAsNewsResponse.Types.Article
{ {
} }

View File

@ -9,6 +9,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{ {
public static class Types public static class Types
{ {
[System.Obsolete]
public class Article : CgibinMaterialAddNewsRequest.Types.Article public class Article : CgibinMaterialAddNewsRequest.Types.Article
{ {
} }

View File

@ -74,4 +74,4 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[System.Text.Json.Serialization.JsonPropertyName("env_version")] [System.Text.Json.Serialization.JsonPropertyName("env_version")]
public string? EnvironmentVersion { get; set; } public string? EnvironmentVersion { get; set; }
} }
} }

View File

@ -1,22 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{ {
/// <summary> /// <summary>
/// <para>表示 [POST] /wxa/business/checkencryptedmsg 接口的响应。</para> /// <para>表示 [POST] /wxa/business/checkencryptedmsg 接口的响应。</para>
/// </summary> /// </summary>
public class WxaBusinessCheckEncryptedMessageResponse : WechatApiResponse public class WxaBusinessCheckEncryptedMessageResponse : WechatApiResponse
{ {
/// <summary> /// <summary>
/// 获取或设置是否是合法的数据。 /// 获取或设置是否是合法的数据。
/// </summary> /// </summary>
[Newtonsoft.Json.JsonProperty("vaild")] [Newtonsoft.Json.JsonProperty("vaild")]
[System.Text.Json.Serialization.JsonPropertyName("vaild")] [System.Text.Json.Serialization.JsonPropertyName("vaild")]
public bool IsValid { get; set; } public bool IsValid { get; set; }
/// <summary> /// <summary>
/// 获取或设置加密数据生成的时间戳。 /// 获取或设置加密数据生成的时间戳。
/// </summary> /// </summary>
[Newtonsoft.Json.JsonProperty("create_time")] [Newtonsoft.Json.JsonProperty("create_time")]
[System.Text.Json.Serialization.JsonPropertyName("create_time")] [System.Text.Json.Serialization.JsonPropertyName("create_time")]
public long CreateTimestamp { get; set; } public long CreateTimestamp { get; set; }
} }
} }

View File

@ -22,4 +22,4 @@
### 【更新日志】 ### 【更新日志】
[点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。 [点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。

View File

@ -8,17 +8,17 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
public abstract class WechatApiResponse : ICommonResponse public abstract class WechatApiResponse : ICommonResponse
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int ICommonResponse.RawStatus { get; set; } int ICommonResponse.RawStatus { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!; IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
byte[] ICommonResponse.RawBytes { get; set; } = default!; byte[] ICommonResponse.RawBytes { get; set; } = default!;

View File

@ -1,4 +1,4 @@
using System; using System;
namespace SKIT.FlurlHttpClient.Wechat.OpenAI namespace SKIT.FlurlHttpClient.Wechat.OpenAI
{ {
@ -35,10 +35,10 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
try try
{ {
if (!Utilities.WxBizMsgCryptor.TryParseXml(callbackXml, out string? encryptedXml)) if (!Utilities.WechatEventDataCryptor.TryParseXml(callbackXml, out string? encryptedXml))
throw new Exceptions.WechatOpenAIEventSerializationException("Encrypt event failed, because of empty encrypted data."); throw new Exceptions.WechatOpenAIEventSerializationException("Encrypt event failed, because of empty encrypted data.");
callbackXml = Utilities.WxBizMsgCryptor.AESDecrypt(cipherText: encryptedXml!, encodingAESKey: client.Credentials.EncodingAESKey!, out _); callbackXml = Utilities.WechatEventDataCryptor.AESDecrypt(cipherText: encryptedXml!, encodingAESKey: client.Credentials.EncodingAESKey!, out _);
return Utilities.XmlUtility.Deserialize<TEvent>(callbackXml); return Utilities.XmlUtility.Deserialize<TEvent>(callbackXml);
} }
catch (WechatOpenAIException) catch (WechatOpenAIException)
@ -104,13 +104,13 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
try try
{ {
string cipher = Utilities.WxBizMsgCryptor.AESEncrypt( string cipher = Utilities.WechatEventDataCryptor.AESEncrypt(
plainText: xml, plainText: xml,
encodingAESKey: client.Credentials.EncodingAESKey!, encodingAESKey: client.Credentials.EncodingAESKey!,
appId: client.Credentials.AppId! appId: client.Credentials.AppId!
); );
xml = Utilities.WxBizMsgCryptor.WrapXml(sToken: client.Credentials.Token!, sMsgEncrypt: cipher); xml = Utilities.WechatEventDataCryptor.WrapXml(sToken: client.Credentials.Token!, sMsgEncrypt: cipher);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Net.Http; using System.Net.Http;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Text; using System.Text;
@ -112,7 +112,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
using var fileContent = new ByteArrayContent(request.FileBytes ?? Array.Empty<byte>()); using var fileContent = new ByteArrayContent(request.FileBytes ?? Array.Empty<byte>());
using var paramContent = new StringContent( using var paramContent = new StringContent(
Utilities.WxBizMsgCryptor.AESEncrypt( Utilities.WechatEventDataCryptor.AESEncrypt(
plainText: Utilities.XmlUtility.Serialize(request), plainText: Utilities.XmlUtility.Serialize(request),
encodingAESKey: client.Credentials.EncodingAESKey!, encodingAESKey: client.Credentials.EncodingAESKey!,
appId: client.Credentials.AppId! appId: client.Credentials.AppId!

View File

@ -1,3 +1,3 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests")] [assembly: InternalsVisibleTo("SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests")]

View File

@ -24,4 +24,4 @@
### 【更新日志】 ### 【更新日志】
[点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。 [点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。

View File

@ -40,7 +40,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="JWT" Version="8.9.0" /> <PackageReference Include="JWT" Version="9.0.0" />
<PackageReference Include="SKIT.FlurlHttpClient.Common" Version="2.5.0" /> <PackageReference Include="SKIT.FlurlHttpClient.Common" Version="2.5.0" />
</ItemGroup> </ItemGroup>

View File

@ -1,4 +1,4 @@
using System; using System;
using JWT; using JWT;
using JWT.Algorithms; using JWT.Algorithms;
using JWT.Serializers; using JWT.Serializers;
@ -10,7 +10,9 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Utilities
{ {
private static readonly Lazy<IJwtEncoder> _encoder = new Lazy<IJwtEncoder>(() => private static readonly Lazy<IJwtEncoder> _encoder = new Lazy<IJwtEncoder>(() =>
{ {
#pragma warning disable CS0618
IJwtAlgorithm algorithm = new HMACSHA256Algorithm(); IJwtAlgorithm algorithm = new HMACSHA256Algorithm();
#pragma warning restore CS0618
IJsonSerializer serializer = new JsonNetSerializer(new JsonSerializer() { NullValueHandling = NullValueHandling.Ignore }); IJsonSerializer serializer = new JsonNetSerializer(new JsonSerializer() { NullValueHandling = NullValueHandling.Ignore });
IBase64UrlEncoder urlEncoder = new JwtBase64UrlEncoder(); IBase64UrlEncoder urlEncoder = new JwtBase64UrlEncoder();
IJwtEncoder encoder = new JwtEncoder(algorithm, serializer, urlEncoder); IJwtEncoder encoder = new JwtEncoder(algorithm, serializer, urlEncoder);

View File

@ -1,4 +1,4 @@
using System; using System;
using JWT; using JWT;
using JWT.Algorithms; using JWT.Algorithms;
using JWT.Serializers; using JWT.Serializers;
@ -10,7 +10,9 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Utilities
{ {
private static readonly Lazy<IJwtEncoder> _encoder = new Lazy<IJwtEncoder>(() => private static readonly Lazy<IJwtEncoder> _encoder = new Lazy<IJwtEncoder>(() =>
{ {
#pragma warning disable CS0618
IJwtAlgorithm algorithm = new HMACSHA256Algorithm(); IJwtAlgorithm algorithm = new HMACSHA256Algorithm();
#pragma warning restore CS0618
IJsonSerializer serializer = new JsonNetSerializer(new JsonSerializer() { NullValueHandling = NullValueHandling.Ignore }); IJsonSerializer serializer = new JsonNetSerializer(new JsonSerializer() { NullValueHandling = NullValueHandling.Ignore });
IBase64UrlEncoder urlEncoder = new JwtBase64UrlEncoder(); IBase64UrlEncoder urlEncoder = new JwtBase64UrlEncoder();
IJwtEncoder encoder = new JwtEncoder(algorithm, serializer, urlEncoder); IJwtEncoder encoder = new JwtEncoder(algorithm, serializer, urlEncoder);

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -10,7 +10,7 @@ using System.Xml;
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Utilities namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Utilities
{ {
public static class WxBizMsgCryptor internal static class WechatEventDataCryptor
{ {
private const int AES_KEY_SIZE = 256; private const int AES_KEY_SIZE = 256;
private const int AES_BLOCK_SIZE = 128; private const int AES_BLOCK_SIZE = 128;

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Net.Http; using System.Net.Http;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -103,7 +103,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
if (data is WechatOpenAIPlatformRequest.Serialization.IEncryptedXmlable) if (data is WechatOpenAIPlatformRequest.Serialization.IEncryptedXmlable)
{ {
string plainXml = Utilities.XmlUtility.Serialize(data); string plainXml = Utilities.XmlUtility.Serialize(data);
string encryptedXml = Utilities.WxBizMsgCryptor.AESEncrypt(plainText: plainXml, encodingAESKey: Credentials.EncodingAESKey!, appId: Credentials.AppId!); string encryptedXml = Utilities.WechatEventDataCryptor.AESEncrypt(plainText: plainXml, encodingAESKey: Credentials.EncodingAESKey!, appId: Credentials.AppId!);
data = new { encrypt = encryptedXml }; data = new { encrypt = encryptedXml };
} }

View File

@ -8,17 +8,17 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
public abstract class WechatOpenAIPlatformResponse : ICommonResponse public abstract class WechatOpenAIPlatformResponse : ICommonResponse
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int ICommonResponse.RawStatus { get; set; } int ICommonResponse.RawStatus { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!; IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
byte[] ICommonResponse.RawBytes { get; set; } = default!; byte[] ICommonResponse.RawBytes { get; set; } = default!;

View File

@ -8,17 +8,17 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
public abstract class WechatOpenAIThirdPartyResponse : ICommonResponse public abstract class WechatOpenAIThirdPartyResponse : ICommonResponse
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int ICommonResponse.RawStatus { get; set; } int ICommonResponse.RawStatus { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!; IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
byte[] ICommonResponse.RawBytes { get; set; } = default!; byte[] ICommonResponse.RawBytes { get; set; } = default!;

View File

@ -2,7 +2,6 @@
using System.Net.Http; using System.Net.Http;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Flurl;
using Flurl.Http; using Flurl.Http;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2 namespace SKIT.FlurlHttpClient.Wechat.TenpayV2

View File

@ -1,3 +1,3 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("SKIT.FlurlHttpClient.Wechat.TenpayV2.UnitTests")] [assembly: InternalsVisibleTo("SKIT.FlurlHttpClient.Wechat.TenpayV2.UnitTests")]

View File

@ -26,4 +26,4 @@
### 【更新日志】 ### 【更新日志】
[点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。 [点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。

View File

@ -44,4 +44,4 @@
<PackageReference Include="SKIT.FlurlHttpClient.Common" Version="2.5.0" /> <PackageReference Include="SKIT.FlurlHttpClient.Common" Version="2.5.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -8,17 +8,17 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2
public abstract class WechatTenpayResponse : ICommonResponse public abstract class WechatTenpayResponse : ICommonResponse
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int ICommonResponse.RawStatus { get; set; } int ICommonResponse.RawStatus { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!; IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
byte[] ICommonResponse.RawBytes { get; set; } = default!; byte[] ICommonResponse.RawBytes { get; set; } = default!;

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Net.Http; using System.Net.Http;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -37,7 +37,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
IFlurlRequest flurlReq = client IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "marketing", "bank", "packages", request.PackageId, "tasks"); .CreateRequest(request, HttpMethod.Post, "marketing", "bank", "packages", request.PackageId, "tasks");
using var httpContent = Utilities.FileHttpContentBuilder.Build(fileName: request.FileName, fileBytes: request.FileBytes, fileContentType: request.FileContentType, fileMetaJson: client.JsonSerializer.Serialize(request)); using var httpContent = Utilities.FileHttpContentBuilder.Build(fileName: request.FileName, fileBytes: request.FileBytes!, fileContentType: request.FileContentType, fileMetaJson: client.JsonSerializer.Serialize(request));
return await client.SendRequestAsync<Models.UploadMarketingBankPackagesTasksResponse>(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken); return await client.SendRequestAsync<Models.UploadMarketingBankPackagesTasksResponse>(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken);
} }
} }

View File

@ -1,3 +1,3 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests")] [assembly: InternalsVisibleTo("SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests")]

View File

@ -24,4 +24,4 @@
### 【更新日志】 ### 【更新日志】
[点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。 [点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。

View File

@ -45,4 +45,4 @@
<PackageReference Include="SKIT.FlurlHttpClient.Common" Version="2.5.0" /> <PackageReference Include="SKIT.FlurlHttpClient.Common" Version="2.5.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -98,7 +98,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Utilities
{ {
InnerReplacePropertyStringValue(ref element, replacement); InnerReplacePropertyStringValue(ref element, replacement);
//if (!array.IsReadOnly) //if (!array.IsReadOnly)
//{ //{
// array.SetValue(element, i); // array.SetValue(element, i);
//} //}
} }

View File

@ -9,17 +9,17 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
public abstract class WechatTenpayResponse : ICommonResponse public abstract class WechatTenpayResponse : ICommonResponse
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int ICommonResponse.RawStatus { get; set; } int ICommonResponse.RawStatus { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!; IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
byte[] ICommonResponse.RawBytes { get; set; } = default!; byte[] ICommonResponse.RawBytes { get; set; } = default!;

View File

@ -29,7 +29,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailGroupCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailGroupCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/exmail/group/update 接口。</para> /// <para>异步调用 [POST] /cgi-bin/exmail/group/update 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
@ -49,7 +49,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailGroupUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailGroupUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/exmail/group/delete 接口。</para> /// <para>异步调用 [POST] /cgi-bin/exmail/group/delete 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
@ -69,7 +69,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailGroupDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailGroupDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [GET] /cgi-bin/exmail/group/search 接口。</para> /// <para>异步调用 [GET] /cgi-bin/exmail/group/search 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
@ -93,7 +93,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailGroupSearchResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailGroupSearchResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [GET] /cgi-bin/exmail/group/get 接口。</para> /// <para>异步调用 [GET] /cgi-bin/exmail/group/get 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
@ -136,7 +136,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailPublicMailCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailPublicMailCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/exmail/publicmail/update 接口。</para> /// <para>异步调用 [POST] /cgi-bin/exmail/publicmail/update 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95511 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95511 </para>
@ -156,7 +156,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailPublicMailUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailPublicMailUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/exmail/publicmail/delete 接口。</para> /// <para>异步调用 [POST] /cgi-bin/exmail/publicmail/delete 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95511 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95511 </para>
@ -176,7 +176,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailPublicMailDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailPublicMailDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [GET] /cgi-bin/exmail/publicmail/search 接口。</para> /// <para>异步调用 [GET] /cgi-bin/exmail/publicmail/search 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
@ -200,7 +200,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailPublicMailSearchResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailPublicMailSearchResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/exmail/publicmail/get 接口。</para> /// <para>异步调用 [POST] /cgi-bin/exmail/publicmail/get 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
@ -221,7 +221,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailPublicMailGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailPublicMailGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
#endregion #endregion
#region Account #region Account
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/exmail/account/act_email 接口。</para> /// <para>异步调用 [POST] /cgi-bin/exmail/account/act_email 接口。</para>
@ -243,7 +243,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailAccountActiveEmailResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailAccountActiveEmailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
#endregion #endregion
#region UserOption #region UserOption
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/exmail/useroption/get 接口。</para> /// <para>异步调用 [POST] /cgi-bin/exmail/useroption/get 接口。</para>
@ -264,7 +264,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinExmailUserOptionGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinExmailUserOptionGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/exmail/useroption/update 接口。</para> /// <para>异步调用 [POST] /cgi-bin/exmail/useroption/update 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95513 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95513 </para>

View File

@ -374,7 +374,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinKfSyncMessageResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinKfSyncMessageResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [GET] /cgi-bin/kf/get_corp_qualification 接口。</para> /// <para>异步调用 [GET] /cgi-bin/kf/get_corp_qualification 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95153 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95153 </para>
@ -394,7 +394,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinKfGetCorpQualificationResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinKfGetCorpQualificationResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/kf/get_corp_statistic 接口。</para> /// <para>异步调用 [POST] /cgi-bin/kf/get_corp_statistic 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95489 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95489 </para>
@ -414,7 +414,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinKfGetCorpStatisticResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinKfGetCorpStatisticResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/kf/get_servicer_statistic 接口。</para> /// <para>异步调用 [POST] /cgi-bin/kf/get_servicer_statistic 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95490 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95490 </para>

View File

@ -436,7 +436,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinReportResidentGetOrderInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinReportResidentGetOrderInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
} }
#endregion #endregion
#region SiteCode #region SiteCode
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/report/sitecode/list 接口。</para> /// <para>异步调用 [POST] /cgi-bin/report/sitecode/list 接口。</para>
@ -457,7 +457,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinReportSiteCodeListResponse>(flurlReq, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinReportSiteCodeListResponse>(flurlReq, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/report/sitecode/get_site_report_info 接口。</para> /// <para>异步调用 [POST] /cgi-bin/report/sitecode/get_site_report_info 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95461 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95461 </para>
@ -477,7 +477,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestWithJsonAsync<Models.CgibinReportSiteCodeGetSiteReportInfoResponse>(flurlReq, cancellationToken: cancellationToken); return await client.SendRequestWithJsonAsync<Models.CgibinReportSiteCodeGetSiteReportInfoResponse>(flurlReq, cancellationToken: cancellationToken);
} }
/// <summary> /// <summary>
/// <para>异步调用 [POST] /cgi-bin/report/sitecode/get_report_answer 接口。</para> /// <para>异步调用 [POST] /cgi-bin/report/sitecode/get_report_answer 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95464 </para> /// <para>REF: https://developer.work.weixin.qq.com/document/path/95464 </para>

View File

@ -73,7 +73,7 @@
public Types.DepartmentIdList? AllowDepartmentIdList { get; set; } public Types.DepartmentIdList? AllowDepartmentIdList { get; set; }
} }
} }
/// <summary> /// <summary>
/// 获取或设置业务邮箱列表。 /// 获取或设置业务邮箱列表。
/// </summary> /// </summary>

View File

@ -43,7 +43,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[Newtonsoft.Json.JsonProperty("userid")] [Newtonsoft.Json.JsonProperty("userid")]
[System.Text.Json.Serialization.JsonPropertyName("userid")] [System.Text.Json.Serialization.JsonPropertyName("userid")]
public string? UserId { get; set; } public string? UserId { get; set; }
/// <summary> /// <summary>
/// 获取或设置功能设置列表。 /// 获取或设置功能设置列表。
/// </summary> /// </summary>

View File

@ -40,4 +40,4 @@
[System.Text.Json.Serialization.JsonPropertyName("rule_list")] [System.Text.Json.Serialization.JsonPropertyName("rule_list")]
public Types.Rule[] RuleList { get; set; } = default!; public Types.Rule[] RuleList { get; set; } = default!;
} }
} }

View File

@ -76,4 +76,4 @@
[System.Text.Json.Serialization.JsonPropertyName("rule")] [System.Text.Json.Serialization.JsonPropertyName("rule")]
public Types.Rule Rule { get; set; } = default!; public Types.Rule Rule { get; set; } = default!;
} }
} }

View File

@ -93,4 +93,4 @@
[System.Text.Json.Serialization.JsonPropertyName("product_list")] [System.Text.Json.Serialization.JsonPropertyName("product_list")]
public Types.Product[] ProductList { get; set; } = default!; public Types.Product[] ProductList { get; set; } = default!;
} }
} }

View File

@ -25,4 +25,4 @@
[System.Text.Json.Serialization.JsonPropertyName("product")] [System.Text.Json.Serialization.JsonPropertyName("product")]
public Types.Product Product { get; set; } = default!; public Types.Product Product { get; set; } = default!;
} }
} }

View File

@ -259,7 +259,7 @@
/// </summary> /// </summary>
[Newtonsoft.Json.JsonProperty("s_timestamp")] [Newtonsoft.Json.JsonProperty("s_timestamp")]
[System.Text.Json.Serialization.JsonPropertyName("s_timestamp")] [System.Text.Json.Serialization.JsonPropertyName("s_timestamp")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualNullableLongConverter))] [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualNullableLongConverter))]
public long? Timestamp { get; set; } public long? Timestamp { get; set; }
} }

View File

@ -361,4 +361,4 @@
[System.Text.Json.Serialization.JsonPropertyName("external_profile")] [System.Text.Json.Serialization.JsonPropertyName("external_profile")]
public Types.ExternalProfile? ExternalProfile { get; set; } public Types.ExternalProfile? ExternalProfile { get; set; }
} }
} }

View File

@ -23,4 +23,4 @@
### 【更新日志】 ### 【更新日志】
[点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。 [点此查看](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/blob/main/CHANGELOG.md)。

View File

@ -43,4 +43,4 @@
<PackageReference Include="SKIT.FlurlHttpClient.Common" Version="2.5.0" /> <PackageReference Include="SKIT.FlurlHttpClient.Common" Version="2.5.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -8,17 +8,17 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
public abstract class WechatWorkResponse : ICommonResponse public abstract class WechatWorkResponse : ICommonResponse
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int ICommonResponse.RawStatus { get; set; } int ICommonResponse.RawStatus { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!; IDictionary<string, string> ICommonResponse.RawHeaders { get; set; } = default!;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
byte[] ICommonResponse.RawBytes { get; set; } = default!; byte[] ICommonResponse.RawBytes { get; set; } = default!;

View File

@ -3,4 +3,4 @@
<packageSources> <packageSources>
<add key="SKIT.FlurlHttpClient.Tools.CodeAnalyzer" value="https://www.myget.org/F/skit/api/v3/index.json" /> <add key="SKIT.FlurlHttpClient.Tools.CodeAnalyzer" value="https://www.myget.org/F/skit/api/v3/index.json" />
</packageSources> </packageSources>
</configuration> </configuration>

View File

@ -1 +1 @@
appsettings.local.json appsettings.local.json

View File

@ -4,10 +4,10 @@
"adcreative_template_id": 263, "adcreative_template_id": 263,
"adcreative_elements": { "adcreative_elements": {
"title": "微信,是一个生活方式!", "title": "微信,是一个生活方式!",
"image_list": [ "<IMAGE_ID>" ], "image_list": ["<IMAGE_ID>"],
"link_name_type": "GET_COUPONS" "link_name_type": "GET_COUPONS"
}, },
"destination_url": "https://weixin.qq.com", "destination_url": "https://weixin.qq.com",
"site_set": [ "SITE_SET_WECHAT" ], "site_set": ["SITE_SET_WECHAT"],
"product_type": "PRODUCT_TYPE_LINK_WECHAT" "product_type": "PRODUCT_TYPE_LINK_WECHAT"
} }

View File

@ -10,10 +10,10 @@
"adcreative_template_id": 263, "adcreative_template_id": 263,
"adcreative_elements": { "adcreative_elements": {
"title": "微信,是一个生活方式!", "title": "微信,是一个生活方式!",
"image_list": [ "51959:7ef00101f6284a318ccf5" ] "image_list": ["51959:7ef00101f6284a318ccf5"]
}, },
"destination_url": "https://weixin.qq.com", "destination_url": "https://weixin.qq.com",
"site_set": [ "SITE_SET_WECHAT" ], "site_set": ["SITE_SET_WECHAT"],
"product_type": "PRODUCT_TYPE_LINK_WECHAT", "product_type": "PRODUCT_TYPE_LINK_WECHAT",
"product_refs_id": "", "product_refs_id": "",
"created_time": 1013554516, "created_time": 1013554516,
@ -27,4 +27,4 @@
"page": 1 "page": 1
} }
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"adcreative_id": 12345, "adcreative_id": 12345,
"adcreative_name": "朋友圈广告创意1" "adcreative_name": "朋友圈广告创意1"
} }

View File

@ -1,4 +1,4 @@
{ {
"errcode": 0, "errcode": 0,
"errmsg": "" "errmsg": ""
} }

View File

@ -1,7 +1,7 @@
{ {
"campaign_id": 12345, "campaign_id": 12345,
"adgroup_name": "朋友圈广告组测试", "adgroup_name": "朋友圈广告组测试",
"site_set": [ "SITE_SET_WECHAT" ], "site_set": ["SITE_SET_WECHAT"],
"product_type": "PRODUCT_TYPE_LINK_WECHAT", "product_type": "PRODUCT_TYPE_LINK_WECHAT",
"begin_date": "2017-06-25", "begin_date": "2017-06-25",
"end_date": "2017-07-01", "end_date": "2017-07-01",
@ -10,13 +10,13 @@
"billing_event": "BILLINGEVENT_IMPRESSION", "billing_event": "BILLINGEVENT_IMPRESSION",
"daily_budget": 1000000, "daily_budget": 1000000,
"targeting": { "targeting": {
"gender": [ "MALE" ], "gender": ["MALE"],
"age": [ "18~30" ], "age": ["18~30"],
"geo_location": { "geo_location": {
"regions": [ 110000, 310000 ], "regions": [110000, 310000],
"location_types": [ "LIVE_IN" ] "location_types": ["LIVE_IN"]
} }
}, },
"time_series": "010100100110100010101010010101010101010100101010101010010101010101001010101010100101010101010111110010101001010110110100110001011001010100101010101010110011001010101010100101100101101110101010101010100110100110010100110101110111101110110110110110110110101101101101110110011101011101101011101101101101001010110111010111011010110110111011", "time_series": "010100100110100010101010010101010101010100101010101010010101010101001010101010100101010101010111110010101001010110110100110001011001010100101010101010110011001010101010100101100101101110101010101010100110100110010100110101110111101110110110110110110110101101101101110110011101011101101011101101101101001010110111010111011010110110111011",
"configured_status": "AD_STATUS_NORMAL" "configured_status": "AD_STATUS_NORMAL"
} }

View File

@ -2,6 +2,6 @@
"errcode": 0, "errcode": 0,
"errmsg": "", "errmsg": "",
"data": { "data": {
"adgroup_id": 123456 "adgroup_id": 123456
} }
} }

View File

@ -1,3 +1,3 @@
{ {
"adgroup_id": 12345 "adgroup_id": 12345
} }

View File

@ -1,4 +1,4 @@
{ {
"errcode": 0, "errcode": 0,
"errmsg": "" "errmsg": ""
} }

View File

@ -7,7 +7,7 @@
"campaign_id": 23456, "campaign_id": 23456,
"adgroup_id": 123456, "adgroup_id": 123456,
"adgroup_name": "朋友圈广告组测试1", "adgroup_name": "朋友圈广告组测试1",
"site_set": [ "SITE_SET_WECHAT" ], "site_set": ["SITE_SET_WECHAT"],
"optimization_goal": "OPTIMIZATIONGOAL_IMPRESSION", "optimization_goal": "OPTIMIZATIONGOAL_IMPRESSION",
"billing_event": "BILLINGEVENT_IMPRESSION", "billing_event": "BILLINGEVENT_IMPRESSION",
"bid_amount": 20000, "bid_amount": 20000,
@ -16,11 +16,11 @@
"product_refs_id": "", "product_refs_id": "",
"targeting": { "targeting": {
"geo_location": { "geo_location": {
"regions": [ 110000, 310000 ], "regions": [110000, 310000],
"location_types": [ "LIVE_IN" ] "location_types": ["LIVE_IN"]
}, },
"age": [ "20~30" ], "age": ["20~30"],
"gender": [ "FEMALE" ] "gender": ["FEMALE"]
}, },
"begin_date": "2017-06-11", "begin_date": "2017-06-11",
"end_date": "2017-06-13", "end_date": "2017-06-13",
@ -39,4 +39,4 @@
"page": 1 "page": 1
} }
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"adgroup_id": 12345, "adgroup_id": 12345,
"adgroup_name": "朋友圈广告组测试1" "adgroup_name": "朋友圈广告组测试1"
} }

View File

@ -1,4 +1,4 @@
{ {
"errcode": 0, "errcode": 0,
"errmsg": "" "errmsg": ""
} }

View File

@ -2,4 +2,4 @@
"adgroup_id": 12345, "adgroup_id": 12345,
"adcreative_id": 12345, "adcreative_id": 12345,
"ad_name": "朋友圈广告测试" "ad_name": "朋友圈广告测试"
} }

View File

@ -2,6 +2,6 @@
"errcode": 0, "errcode": 0,
"errmsg": "", "errmsg": "",
"data": { "data": {
"ad_id": 456789 "ad_id": 456789
} }
} }

View File

@ -1,3 +1,3 @@
{ {
"ad_id": 12345 "ad_id": 12345
} }

View File

@ -1,4 +1,4 @@
{ {
"errcode": 0, "errcode": 0,
"errmsg": "" "errmsg": ""
} }

View File

@ -15,10 +15,10 @@
"adcreative_template_id": 263, "adcreative_template_id": 263,
"adcreative_elements": { "adcreative_elements": {
"title": "微信,是一个生活方式!", "title": "微信,是一个生活方式!",
"image_list": [ "51959:7ef00101f6284a318ccf5" ] "image_list": ["51959:7ef00101f6284a318ccf5"]
}, },
"destination_url": "https://weixin.qq.com", "destination_url": "https://weixin.qq.com",
"site_set": [ "SITE_SET_WECHAT" ], "site_set": ["SITE_SET_WECHAT"],
"product_type": "PRODUCT_TYPE_LINK_WECHAT", "product_type": "PRODUCT_TYPE_LINK_WECHAT",
"product_refs_id": "", "product_refs_id": "",
"created_time": 1013554516, "created_time": 1013554516,
@ -38,4 +38,4 @@
"page": 1 "page": 1
} }
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"ad_id": 12345, "ad_id": 12345,
"ad_name": "朋友圈广告测试1" "ad_name": "朋友圈广告测试1"
} }

View File

@ -1,4 +1,4 @@
{ {
"errcode": 0, "errcode": 0,
"errmsg": "" "errmsg": ""
} }

View File

@ -3,4 +3,4 @@
"contact_person": "test", "contact_person": "test",
"contact_person_telephone": "13900000000", "contact_person_telephone": "13900000000",
"business_type": "OFFLINE" "business_type": "OFFLINE"
} }

View File

@ -1,4 +1,4 @@
{ {
"errcode": 0, "errcode": 0,
"errmsg": "succeed" "errmsg": "succeed"
} }

View File

@ -10,4 +10,4 @@
"business_type": "OFFLINE", "business_type": "OFFLINE",
"business_content": "" "business_content": ""
} }
} }

View File

@ -3,4 +3,4 @@
"contact_person": "test", "contact_person": "test",
"contact_person_telephone": "13900000000", "contact_person_telephone": "13900000000",
"business_type": "OFFLINE" "business_type": "OFFLINE"
} }

View File

@ -1,4 +1,4 @@
{ {
"errcode": 0, "errcode": 0,
"errmsg": "succeed" "errmsg": "succeed"
} }

View File

@ -6,4 +6,4 @@
"date": "2019-03-24" "date": "2019-03-24"
} }
} }
} }

View File

@ -4,4 +4,4 @@
"data": { "data": {
"task_id": 12345 "task_id": 12345
} }
} }

View File

@ -30,4 +30,4 @@
"total_page": 1 "total_page": 1
} }
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"errcode": 0, "errcode": 0,
"errmsg": "" "errmsg": ""
} }

View File

@ -3,4 +3,4 @@
"campaign_type": "CAMPAIGN_TYPE_WECHAT_MOMENTS", "campaign_type": "CAMPAIGN_TYPE_WECHAT_MOMENTS",
"product_type": "PRODUCT_TYPE_LINK_WECHAT", "product_type": "PRODUCT_TYPE_LINK_WECHAT",
"configured_status": "AD_STATUS_SUSPEND" "configured_status": "AD_STATUS_SUSPEND"
} }

Some files were not shown because too many files have changed in this diff Show More