style(tenpayv3): clean code

This commit is contained in:
Fu Diwei
2022-01-21 14:30:17 +08:00
parent b442a3d618
commit 215aea8fb8
529 changed files with 507 additions and 1789 deletions

View File

@@ -1,13 +1,6 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Services.BackgroundJobs
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Services.BackgroundJobs
{
using SKIT.FlurlHttpClient.Wechat.TenpayV3.Models;
using SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings;
class TenpayCertificateRefreshingBackgroundJob
internal class TenpayCertificateRefreshingBackgroundJob
{
private readonly HttpClients.IWechatTenpayHttpClientFactory _tenpayHttpClientFactory;

View File

@@ -1,7 +1,5 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Services.HttpClients
{
using SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings;
public interface IWechatTenpayCertificateManagerFactory
{
CertificateManager Create(string merchantId);

View File

@@ -1,10 +1,6 @@
using System.Collections.Concurrent;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Services.HttpClients.Implements
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Services.HttpClients.Implements
{
using SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings;
partial class WechatTenpayCertificateManagerFactory : IWechatTenpayCertificateManagerFactory
internal partial class WechatTenpayCertificateManagerFactory : IWechatTenpayCertificateManagerFactory
{
private readonly ConcurrentDictionary<string, CertificateManager> _dict;

View File

@@ -1,9 +1,6 @@
using System;
using System.Linq;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Services.HttpClients.Implements
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Services.HttpClients.Implements
{
partial class WechatTenpayHttpClientFactory : IWechatTenpayHttpClientFactory
internal partial class WechatTenpayHttpClientFactory : IWechatTenpayHttpClientFactory
{
private readonly IWechatTenpayCertificateManagerFactory _tenpayCertificateManagerFactory;
@@ -18,7 +15,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Services.HttpClients.Imple
// NOTICE:
// 这里的工厂方法是为了演示多租户而存在的,可根据商户号生成不同的 API 客户端。
// 如果你的项目只存在唯一一个租户,那么直接注入 `WechatTenpayClient` 即可。
var tenpayMerchantOptions = Options.TenpayOptions.Instance.Value.Merchants?.FirstOrDefault(e => string.Equals(merchantId, e.MerchantId));
if (tenpayMerchantOptions == null)
throw new Exception("未在配置项中找到该 MerchantId 对应的微信商户号。");