Skip to content

Commit

Permalink
升级silky组件版本号
Browse files Browse the repository at this point in the history
  • Loading branch information
liuhll committed Mar 8, 2024
1 parent 0e3bc3d commit d813e60
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 20 deletions.
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<LicenseUrl>https://raw.githubusercontent.com/liuhll/silky/main/LICENSE</LicenseUrl>

<Version>3.8.16</Version>
<Version>3.8.17</Version>

<PackageIconUrl>https://raw.githubusercontent.com/liuhll/silky/main/docs/.vuepress/public/assets/logo/logo.png</PackageIconUrl>

Expand Down
27 changes: 13 additions & 14 deletions framework/src/Silky.Rpc/Runtime/Server/ServiceEntry/ServiceEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ private void CreateCachingInterceptorDescriptors()
{
foreach (var cacheKey in parameterDescriptor.CacheKeys)
{

if (!cacheKey.Key.Equals(cachingInterceptorProvider.KeyTemplate))
{
continue;
Expand All @@ -125,17 +124,17 @@ private void CreateCachingInterceptorDescriptors()
foreach (var cacheKeyProvider in cacheKey.Value)
{
cachingInterceptorDescriptor
.CacheKeyProviderDescriptors
.Add(new CacheKeyProviderDescriptor()
{
PropName = cacheKeyProvider.PropName,
Index = cacheKeyProvider.Index,
CacheKeyType = cacheKeyProvider.CacheKeyType,
ParameterIndex = parameterDescriptor.Index,
From = parameterDescriptor.From,
IsSampleOrNullableType = parameterDescriptor.IsSingleType,
IsNullableType = parameterDescriptor.IsNullableType,
});
.CacheKeyProviderDescriptors
.Add(new CacheKeyProviderDescriptor()
{
PropName = cacheKeyProvider.PropName,
Index = cacheKeyProvider.Index,
CacheKeyType = cacheKeyProvider.CacheKeyType,
ParameterIndex = parameterDescriptor.Index,
From = parameterDescriptor.From,
IsSampleOrNullableType = parameterDescriptor.IsSingleType,
IsNullableType = parameterDescriptor.IsNullableType,
});
}
}
}
Expand Down Expand Up @@ -342,7 +341,7 @@ private void CreateFallBackExecutor()

private void CreateDefaultSupportedResponseMediaTypes()
{
if (!this.NeedHttpProtocolSupport() && (ReturnType != null || ReturnType == typeof(void)))
if (!this.ActionResultSupport() && (ReturnType != null || ReturnType == typeof(void)))
{
SupportedResponseMediaTypes.Add("application/json");
SupportedResponseMediaTypes.Add("text/json");
Expand All @@ -351,7 +350,7 @@ private void CreateDefaultSupportedResponseMediaTypes()

private void CreateDefaultSupportedRequestMediaTypes()
{
if (Parameters.Any(p => p.From == ParameterFrom.Form) || this.NeedHttpProtocolSupport())
if (Parameters.Any(p => p.From == ParameterFrom.Form) || this.HasFileParameter())
{
SupportedRequestMediaTypes.Add("multipart/form-data");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ public static IRemoveMatchKeyCachingInterceptProvider[]

public static bool NeedHttpProtocolSupport(this ServiceEntry serviceEntry)
{
// if (typeof(IActionResult).IsAssignableFrom(serviceEntry.ReturnType))
// {
// return true;
// }
if (typeof(IActionResult).IsAssignableFrom(serviceEntry.ReturnType))
{
return true;
}

foreach (var parameterDescriptor in serviceEntry.Parameters)
{
Expand All @@ -197,6 +197,29 @@ public static bool NeedHttpProtocolSupport(this ServiceEntry serviceEntry)
return false;
}

public static bool ActionResultSupport(this ServiceEntry serviceEntry)
{
if (typeof(IActionResult).IsAssignableFrom(serviceEntry.ReturnType))
{
return true;
}

return false;
}

public static bool HasFileParameter(this ServiceEntry serviceEntry)
{
foreach (var parameterDescriptor in serviceEntry.Parameters)
{
if (parameterDescriptor.IsSupportFileParameter())
{
return true;
}
}

return false;
}

public static bool IsSilkyAppService(this ServiceEntry serviceEntry)
{
return "Silky.Http.Dashboard.AppService.ISilkyAppService".Equals(serviceEntry.ServiceType.FullName);
Expand Down
2 changes: 1 addition & 1 deletion templates/app/content/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
<SilkyVersion>3.8.16</SilkyVersion>
<SilkyVersion>3.8.17</SilkyVersion>
</PropertyGroup>
</Project>

0 comments on commit d813e60

Please sign in to comment.