docs: 完善文档

This commit is contained in:
Fu Diwei
2021-11-26 02:59:02 +08:00
parent 53b7ed0b60
commit 0c7cd5e1df
9 changed files with 39 additions and 15 deletions

View File

@@ -49,3 +49,27 @@ public class MyFakeEvent : WechatTenpayEvent.Types.IDecryptedResource
public string MyFakeProps { get; set; }
}
```
---
### 敏感信息字段
如果你扩展的自定义请求或响应模型中包含敏感信息字段,并希望可以通过本库提供的 `EncryptRequestSensitiveProperty()``DecryptResponseSensitiveProperty()` 两个扩展方法来实现自动加、解密,那么你需要在定义模型时额外指定一个特性:
```csharp
public class MyFakeRequest : WechatTenpayRequest
{
[Newtonsoft.Json.JsonProperty("my_fake_props")]
[System.Text.Json.Serialization.JsonPropertyName("my_fake_props")]
[WechatTenpaySensitiveProperty("my_alg")]
public string MyFakeProps { get; set; }
}
public class MyFakeResponse : WechatTenpayResponse
{
[Newtonsoft.Json.JsonProperty("my_fake_props")]
[System.Text.Json.Serialization.JsonPropertyName("my_fake_props")]
[WechatTenpaySensitiveProperty("my_alg")]
public string MyFakeProps { get; set; }
}
```