feat: 移除基础依赖库,升级公共组件,并适配 .NET 6.0

This commit is contained in:
Fu Diwei
2021-11-09 15:23:23 +08:00
parent b11f6bb73b
commit acea1b477c
62 changed files with 149 additions and 221 deletions

View File

@@ -85,9 +85,9 @@ namespace SKIT.FlurlHttpClient.Wechat
if (name.EndsWith("Request"))
{
if (!typeof(IWechatRequest).IsAssignableFrom(modelType))
if (!typeof(ICommonRequest).IsAssignableFrom(modelType))
{
lstError.Add(new Exception($"`{name}` 类需实现自 `IWechatRequest`。"));
lstError.Add(new Exception($"`{name}` 类需实现自 `ICommonRequest`。"));
continue;
}
@@ -100,9 +100,9 @@ namespace SKIT.FlurlHttpClient.Wechat
if (name.EndsWith("Response"))
{
if (!typeof(IWechatResponse).IsAssignableFrom(modelType))
if (!typeof(ICommonResponse).IsAssignableFrom(modelType))
{
lstError.Add(new Exception($"`{name}` 类需实现自 `IWechatResponse`。"));
lstError.Add(new Exception($"`{name}` 类需实现自 `ICommonResponse`。"));
continue;
}
@@ -252,7 +252,7 @@ namespace SKIT.FlurlHttpClient.Wechat
.Where(e =>
e.IsPublic &&
e.IsStatic &&
typeof(IWechatClient).IsAssignableFrom(e.GetParameters().FirstOrDefault().ParameterType)
typeof(ICommonClient).IsAssignableFrom(e.GetParameters().FirstOrDefault().ParameterType)
)
.ToArray();
@@ -267,10 +267,10 @@ namespace SKIT.FlurlHttpClient.Wechat
continue;
}
// 第二个参数必为 IWechatRequest 子类
if (!typeof(IWechatRequest).IsAssignableFrom(lstParamInfo[1].ParameterType))
// 第二个参数必为 ICommonRequest 子类
if (!typeof(ICommonRequest).IsAssignableFrom(lstParamInfo[1].ParameterType))
{
lstError.Add(new Exception($"`{extType.Name}.{methodInfo.Name}` 方法第 1 个入参需实现自 `IWechatRequest`。"));
lstError.Add(new Exception($"`{extType.Name}.{methodInfo.Name}` 方法第 1 个入参需实现自 `ICommonRequest`。"));
continue;
}