Browse Source

feat: 移除AbpSwashbuckleModule

main
wangjunzzz 2 months ago
parent
commit
c4a48dc919
  1. 2
      aspnet-core/Directory.Build.Volo.targets
  2. 4
      aspnet-core/Directory.Build.targets
  3. 4
      aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/GlobalUsings.cs
  4. 4
      aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Lion.AbpPro.AspNetCore.csproj
  5. 2
      aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Lion/AbpPro/AspNetCore/AbpProAspNetCoreModule.cs
  6. 2
      aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Microsoft/AspNetCore/Builder/ApplicationBuilderExtensions.cs
  7. 2
      aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Microsoft/AspNetCore/Mvc/Filters/AbpProExceptionFilter.cs
  8. 33
      aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Microsoft/Extensions/DependencyInjection/ServiceCollectionExtensions.cs
  9. 4
      aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Swagger/CachingSwaggerProvider.cs
  10. 20
      aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Swagger/EnumSchemaFilter.cs
  11. 48
      aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Swagger/HiddenAbpDefaultApiFilter.cs
  12. 1
      aspnet-core/frameworks/src/Lion.AbpPro.Core/Lion.AbpPro.Core.csproj
  13. 4
      aspnet-core/modules/BasicManagement/host/Lion.AbpPro.BasicManagement.HttpApi.Host/BasicManagementHttpApiHostModule.cs
  14. 1
      aspnet-core/modules/BasicManagement/host/Lion.AbpPro.BasicManagement.HttpApi.Host/GlobalUsings.cs
  15. 1
      aspnet-core/modules/BasicManagement/host/Lion.AbpPro.BasicManagement.HttpApi.Host/Lion.AbpPro.BasicManagement.HttpApi.Host.csproj
  16. 3
      aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Lion.AbpPro.BasicManagement.Application.csproj
  17. 3
      aspnet-core/modules/DataDictionaryManagement/host/Lion.AbpPro.DataDictionaryManagement.HttpApi.Host/DataDictionaryManagementHttpApiHostModule.cs
  18. 1
      aspnet-core/modules/DataDictionaryManagement/host/Lion.AbpPro.DataDictionaryManagement.HttpApi.Host/GlobalUsings.cs
  19. 1
      aspnet-core/modules/DataDictionaryManagement/host/Lion.AbpPro.DataDictionaryManagement.HttpApi.Host/Lion.AbpPro.DataDictionaryManagement.HttpApi.Host.csproj
  20. 4
      aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/FileManagementHttpApiHostModule.cs
  21. 2
      aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/GlobalUsings.cs
  22. 1
      aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Lion.AbpPro.FileManagement.HttpApi.Host.csproj
  23. 2
      aspnet-core/modules/LanguageManagement/host/Lion.AbpPro.LanguageManagement.HttpApi.Host/GlobalUsings.cs
  24. 4
      aspnet-core/modules/LanguageManagement/host/Lion.AbpPro.LanguageManagement.HttpApi.Host/LanguageManagementHttpApiHostModule.cs
  25. 1
      aspnet-core/modules/LanguageManagement/host/Lion.AbpPro.LanguageManagement.HttpApi.Host/Lion.AbpPro.LanguageManagement.HttpApi.Host.csproj
  26. 2
      aspnet-core/modules/NotificationManagement/host/Lion.AbpPro.NotificationManagement.HttpApi.Host/GlobalUsings.cs
  27. 1
      aspnet-core/modules/NotificationManagement/host/Lion.AbpPro.NotificationManagement.HttpApi.Host/Lion.AbpPro.NotificationManagement.HttpApi.Host.csproj
  28. 4
      aspnet-core/modules/NotificationManagement/host/Lion.AbpPro.NotificationManagement.HttpApi.Host/NotificationManagementHttpApiHostModule.cs
  29. 11
      aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs
  30. 1
      aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/GlobalUsings.cs
  31. 1
      aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Lion.AbpPro.HttpApi.Host.csproj

2
aspnet-core/Directory.Build.Volo.targets

@ -34,7 +34,6 @@
<PackageReference Update="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="10.0.1"/> <PackageReference Update="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="10.0.1"/>
<PackageReference Update="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="10.0.1"/> <PackageReference Update="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="10.0.1"/>
<PackageReference Update="Volo.Abp.AspNetCore.Serilog" Version="10.0.1"/> <PackageReference Update="Volo.Abp.AspNetCore.Serilog" Version="10.0.1"/>
<PackageReference Update="Volo.Abp.Swashbuckle" Version="10.0.1"/>
<PackageReference Update="Volo.Abp.Ddd.Application" Version="10.0.1"/> <PackageReference Update="Volo.Abp.Ddd.Application" Version="10.0.1"/>
<PackageReference Update="Volo.Abp.Ddd.Application.Contracts" Version="10.0.1"/> <PackageReference Update="Volo.Abp.Ddd.Application.Contracts" Version="10.0.1"/>
<PackageReference Update="Volo.Abp.Authorization" Version="10.0.1"/> <PackageReference Update="Volo.Abp.Authorization" Version="10.0.1"/>
@ -94,5 +93,6 @@
<PackageReference Update="Volo.Abp.EventBus" Version="10.0.1"/> <PackageReference Update="Volo.Abp.EventBus" Version="10.0.1"/>
<PackageReference Update="Volo.Abp.Localization" Version="10.0.1" /> <PackageReference Update="Volo.Abp.Localization" Version="10.0.1" />
<PackageReference Update="Volo.Abp.DistributedLocking" Version="10.0.1" /> <PackageReference Update="Volo.Abp.DistributedLocking" Version="10.0.1" />
<PackageReference Update="Volo.Abp.Guids" Version="10.0.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

4
aspnet-core/Directory.Build.targets

@ -58,8 +58,8 @@
<!-- Swagger <!-- Swagger
<PackageReference Update="Swashbuckle.AspNetCore.SwaggerUI" Version="10.0.0"/> --> <PackageReference Update="Swashbuckle.AspNetCore.SwaggerUI" Version="10.0.0"/> -->
<PackageReference Update="Swashbuckle.AspNetCore" Version="9.0.4"/> <PackageReference Update="Swashbuckle.AspNetCore" Version="10.0.1"/>
<PackageReference Update="Swashbuckle.AspNetCore.Annotations" Version="9.0.4"/> <PackageReference Update="Swashbuckle.AspNetCore.Annotations" Version="10.0.1"/>
<!-- Serilog 日志--> <!-- Serilog 日志-->
<PackageReference Update="Serilog" Version="4.3.0"/> <PackageReference Update="Serilog" Version="4.3.0"/>

4
aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/GlobalUsings.cs

@ -17,7 +17,6 @@ global using Lion.AbpPro;
global using Lion.AbpPro.Core; global using Lion.AbpPro.Core;
global using Lion.AbpPro.Localization; global using Lion.AbpPro.Localization;
global using Microsoft.AspNetCore.Http; global using Microsoft.AspNetCore.Http;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.AspNetCore.Mvc.Abstractions; global using Microsoft.AspNetCore.Mvc.Abstractions;
global using Microsoft.AspNetCore.Mvc.ApiExplorer; global using Microsoft.AspNetCore.Mvc.ApiExplorer;
global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore;
@ -27,8 +26,6 @@ global using Microsoft.Extensions.Localization;
global using Microsoft.Extensions.Logging; global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Logging.Abstractions; global using Microsoft.Extensions.Logging.Abstractions;
global using Microsoft.Extensions.Options; global using Microsoft.Extensions.Options;
global using Microsoft.OpenApi.Any;
global using Microsoft.OpenApi.Models;
global using Ocelot.Middleware; global using Ocelot.Middleware;
global using Serilog.Exceptions; global using Serilog.Exceptions;
global using Serilog.Sinks.Elasticsearch; global using Serilog.Sinks.Elasticsearch;
@ -36,7 +33,6 @@ global using Swashbuckle.AspNetCore.Swagger;
global using Swashbuckle.AspNetCore.SwaggerGen; global using Swashbuckle.AspNetCore.SwaggerGen;
global using Volo.Abp.AspNetCore.ExceptionHandling; global using Volo.Abp.AspNetCore.ExceptionHandling;
global using Volo.Abp.AspNetCore.Mvc; global using Volo.Abp.AspNetCore.Mvc;
global using Volo.Abp.AspNetCore.Mvc.ExceptionHandling;
global using Volo.Abp.Authorization; global using Volo.Abp.Authorization;
global using Volo.Abp.DependencyInjection; global using Volo.Abp.DependencyInjection;
global using Volo.Abp.Domain.Entities; global using Volo.Abp.Domain.Entities;

4
aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Lion.AbpPro.AspNetCore.csproj

@ -12,8 +12,10 @@
<PackageReference Include="Volo.Abp.AspNetCore" /> <PackageReference Include="Volo.Abp.AspNetCore" />
<PackageReference Include="Volo.Abp.Autofac" /> <PackageReference Include="Volo.Abp.Autofac" />
<PackageReference Include="Volo.Abp.Core" /> <PackageReference Include="Volo.Abp.Core" />
<PackageReference Include="Volo.Abp.Swashbuckle" /> <PackageReference Include="Swashbuckle.AspNetCore" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" /> <PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" /> <PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" /> <PackageReference Include="MiniProfiler.AspNetCore.Mvc" />
<PackageReference Include="MiniProfiler.EntityFrameworkCore" /> <PackageReference Include="MiniProfiler.EntityFrameworkCore" />

2
aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Lion/AbpPro/AspNetCore/AbpProAspNetCoreModule.cs

@ -1,9 +1,7 @@
using Lion.AbpPro.AspNetCore.Options; using Lion.AbpPro.AspNetCore.Options;
using Volo.Abp.Swashbuckle;
namespace Lion.AbpPro.AspNetCore; namespace Lion.AbpPro.AspNetCore;
//[DependsOn(typeof(AbpSwashbuckleModule))]
public class AbpProAspNetCoreModule : AbpModule public class AbpProAspNetCoreModule : AbpModule
{ {
public override void PreConfigureServices(ServiceConfigurationContext context) public override void PreConfigureServices(ServiceConfigurationContext context)

2
aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Microsoft/AspNetCore/Builder/ApplicationBuilderExtensions.cs

@ -84,7 +84,7 @@ public static class ApplicationBuilderExtensions
var swaggerOptions = app.ApplicationServices.GetRequiredService<IOptions<AbpProSwaggerOptions>>().Value; var swaggerOptions = app.ApplicationServices.GetRequiredService<IOptions<AbpProSwaggerOptions>>().Value;
if (!swaggerOptions.Enabled) return app; if (!swaggerOptions.Enabled) return app;
app.UseSwagger(); app.UseSwagger();
app.UseAbpSwaggerUI(options => app.UseSwaggerUI(options =>
{ {
options.SwaggerEndpoint(endpoint, name); options.SwaggerEndpoint(endpoint, name);
options.DocExpansion(DocExpansion.None); options.DocExpansion(DocExpansion.None);

2
aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Microsoft/AspNetCore/Mvc/Filters/AbpProExceptionFilter.cs

@ -1,3 +1,5 @@
using Volo.Abp.AspNetCore.Mvc.ExceptionHandling;
namespace Microsoft.AspNetCore.Mvc.Filters; namespace Microsoft.AspNetCore.Mvc.Filters;
[Dependency(ReplaceServices = true)] [Dependency(ReplaceServices = true)]

33
aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Microsoft/Extensions/DependencyInjection/ServiceCollectionExtensions.cs

@ -2,8 +2,10 @@
using Lion.AbpPro.AspNetCore; using Lion.AbpPro.AspNetCore;
using Lion.AbpPro.AspNetCore.Options; using Lion.AbpPro.AspNetCore.Options;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi;
using Swagger; using Swagger;
using Volo.Abp.AspNetCore.Auditing; using Volo.Abp.AspNetCore.Auditing;
using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.MultiTenancy;
@ -158,7 +160,7 @@ public static class ServiceCollectionExtensions
service.AddSwaggerGen(options => service.AddSwaggerGen(options =>
{ {
// 文件下载类型 // 文件下载类型
options.MapType<FileContentResult>(() => new OpenApiSchema() { Type = "file" }); //options.MapType<FileContentResult>(() => new OpenApiSchema() { Type = "file" });
options.SwaggerDoc(name, new OpenApiInfo { Title = name, Version = version }); options.SwaggerDoc(name, new OpenApiInfo { Title = name, Version = version });
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
//options.EnableAnnotations(); // 启用注解 //options.EnableAnnotations(); // 启用注解
@ -181,21 +183,12 @@ public static class ServiceCollectionExtensions
Scheme = JwtBearerDefaults.AuthenticationScheme, Scheme = JwtBearerDefaults.AuthenticationScheme,
BearerFormat = "JWT" BearerFormat = "JWT"
}); });
options.AddSecurityRequirement(new OpenApiSecurityRequirement
options.AddSecurityRequirement(document => new OpenApiSecurityRequirement()
{ {
{ [new OpenApiSecuritySchemeReference("Bearer", document)] = []
new OpenApiSecurityScheme
{
Reference = new OpenApiReference
{
Type = ReferenceType.SecurityScheme, Id = "Bearer"
}
},
new List<string>()
}
}); });
options.AddSecurityDefinition("Accept-Language", new OpenApiSecurityScheme()
options.AddSecurityDefinition("ApiKey", new OpenApiSecurityScheme()
{ {
Type = SecuritySchemeType.ApiKey, Type = SecuritySchemeType.ApiKey,
In = ParameterLocation.Header, In = ParameterLocation.Header,
@ -203,17 +196,11 @@ public static class ServiceCollectionExtensions
Description = "多语言设置,系统预设语言有zh-Hans、en,默认为zh-Hans", Description = "多语言设置,系统预设语言有zh-Hans、en,默认为zh-Hans",
}); });
options.AddSecurityRequirement(new OpenApiSecurityRequirement options.AddSecurityRequirement(document => new OpenApiSecurityRequirement()
{ {
{ [new OpenApiSecuritySchemeReference("Accept-Language", document)] = []
new OpenApiSecurityScheme
{
Reference = new OpenApiReference
{ Type = ReferenceType.SecurityScheme, Id = "ApiKey" }
},
Array.Empty<string>()
}
}); });
}); });
return service; return service;
} }

4
aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Swagger/CachingSwaggerProvider.cs

@ -1,4 +1,6 @@
namespace Swagger; using Microsoft.OpenApi;
namespace Swagger;
/// <summary> /// <summary>
/// swagger注释加载慢,把文档添加到缓存 /// swagger注释加载慢,把文档添加到缓存

20
aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Swagger/EnumSchemaFilter.cs

@ -1,3 +1,6 @@
using System.Text.Json.Nodes;
using Microsoft.OpenApi;
namespace Swagger; namespace Swagger;
/// <summary> /// <summary>
@ -6,16 +9,17 @@ namespace Swagger;
/// </summary> /// </summary>
public class EnumSchemaFilter : ISchemaFilter public class EnumSchemaFilter : ISchemaFilter
{ {
public void Apply(OpenApiSchema schema, SchemaFilterContext context) public void Apply(IOpenApiSchema schema, SchemaFilterContext context)
{ {
if (context.Type.IsEnum) if (schema is OpenApiSchema openApiScheme && context.Type.IsEnum)
{ {
var array = new OpenApiArray(); openApiScheme.Enum?.Clear();
array.AddRange(Enum.GetNames(context.Type).Select(n => new OpenApiString(n))); openApiScheme.Type = JsonSchemaType.String;
// NSwag openApiScheme.Format = null;
schema.Extensions.Add("x-enumNames", array); foreach (var name in Enum.GetNames(context.Type))
// Openapi-generator {
schema.Extensions.Add("x-enum-varnames", array); openApiScheme.Enum?.Add(JsonNode.Parse($"\"{name}\"")!);
}
} }
} }
} }

48
aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Swagger/HiddenAbpDefaultApiFilter.cs

@ -1,3 +1,5 @@
using Microsoft.OpenApi;
namespace Swagger; namespace Swagger;
/// <summary> /// <summary>
@ -8,15 +10,57 @@ public class HiddenAbpDefaultApiFilter : IDocumentFilter
{ {
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{ {
// 首先收集需要移除的路径
var pathsToRemove = new List<string>();
foreach (ApiDescription apiDescription in context.ApiDescriptions) foreach (ApiDescription apiDescription in context.ApiDescriptions)
{ {
if (apiDescription.TryGetMethodInfo(out MethodInfo method)) if (apiDescription.TryGetMethodInfo(out MethodInfo method))
{ {
string key = "/" + apiDescription.RelativePath; string key = "/" + apiDescription.RelativePath;
var reuslt = IsHidden(key); var result = IsHidden(key);
if (reuslt) swaggerDoc.Paths.Remove(key); if (result)
pathsToRemove.Add(key);
}
}
// 移除匹配的路径
foreach (var path in pathsToRemove)
{
swaggerDoc.Paths.Remove(path);
}
// 检查并移除空的标签(分组)
RemoveEmptyTags(swaggerDoc);
}
private void RemoveEmptyTags(OpenApiDocument swaggerDoc)
{
if (swaggerDoc.Tags == null || !swaggerDoc.Tags.Any())
return;
// 获取所有路径中使用的标签
var usedTags = new HashSet<string>();
foreach (var pathItem in swaggerDoc.Paths)
{
foreach (var operation in pathItem.Value.Operations.Values)
{
if (operation.Tags != null)
{
foreach (var tag in operation.Tags)
{
usedTags.Add(tag.Name);
}
}
} }
} }
// 移除未使用的标签
var tagsToRemove = swaggerDoc.Tags.Where(tag => !usedTags.Contains(tag.Name)).ToList();
foreach (var tag in tagsToRemove)
{
swaggerDoc.Tags.Remove(tag);
}
} }
private bool IsHidden(string key) private bool IsHidden(string key)

1
aspnet-core/frameworks/src/Lion.AbpPro.Core/Lion.AbpPro.Core.csproj

@ -8,6 +8,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Mapster"/> <PackageReference Include="Mapster"/>
<PackageReference Include="Volo.Abp.Guids"/>
<ProjectReference Include="..\Lion.AbpPro.Localization\Lion.AbpPro.Localization.csproj"/> <ProjectReference Include="..\Lion.AbpPro.Localization\Lion.AbpPro.Localization.csproj"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

4
aspnet-core/modules/BasicManagement/host/Lion.AbpPro.BasicManagement.HttpApi.Host/BasicManagementHttpApiHostModule.cs

@ -11,7 +11,7 @@ namespace Lion.AbpPro.BasicManagement;
typeof(AbpCachingStackExchangeRedisModule), typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpEntityFrameworkCorePostgreSqlModule), typeof(AbpEntityFrameworkCorePostgreSqlModule),
typeof(AbpAspNetCoreSerilogModule), typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpProAspNetCoreModule) typeof(AbpProAspNetCoreModule)
)] )]
public class BasicManagementHttpApiHostModule : AbpModule public class BasicManagementHttpApiHostModule : AbpModule
@ -50,7 +50,7 @@ public class BasicManagementHttpApiHostModule : AbpModule
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseAuthorization(); app.UseAuthorization();
app.UseSwagger(); app.UseSwagger();
app.UseAbpSwaggerUI(options => app.UseSwaggerUI(options =>
{ {
options.SwaggerEndpoint("/swagger/BasicManagement/swagger.json", "BasicManagement API"); options.SwaggerEndpoint("/swagger/BasicManagement/swagger.json", "BasicManagement API");
options.DocExpansion(DocExpansion.None); options.DocExpansion(DocExpansion.None);

1
aspnet-core/modules/BasicManagement/host/Lion.AbpPro.BasicManagement.HttpApi.Host/GlobalUsings.cs

@ -20,4 +20,3 @@ global using Volo.Abp.Caching.StackExchangeRedis;
global using Volo.Abp.EntityFrameworkCore; global using Volo.Abp.EntityFrameworkCore;
global using Volo.Abp.Localization; global using Volo.Abp.Localization;
global using Volo.Abp.Modularity; global using Volo.Abp.Modularity;
global using Volo.Abp.Swashbuckle;

1
aspnet-core/modules/BasicManagement/host/Lion.AbpPro.BasicManagement.HttpApi.Host/Lion.AbpPro.BasicManagement.HttpApi.Host.csproj

@ -19,7 +19,6 @@
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" /> <PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Swashbuckle" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" />

3
aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Lion.AbpPro.BasicManagement.Application.csproj

@ -9,9 +9,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application" /> <PackageReference Include="Volo.Abp.Ddd.Application" />
<PackageReference Include="Volo.Abp.Account.Application" /> <PackageReference Include="Volo.Abp.Account.Application" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" />
<PackageReference Include="Volo.Abp.Identity.Application" /> <PackageReference Include="Volo.Abp.Identity.Application" />
<PackageReference Include="Volo.Abp.Identity.AspNetCore" /> <PackageReference Include="Volo.Abp.Identity.AspNetCore" />
<PackageReference Include="Volo.Abp.AspNetCore" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" /> <PackageReference Include="Volo.Abp.PermissionManagement.Application" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" /> <PackageReference Include="Volo.Abp.TenantManagement.Application" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" /> <PackageReference Include="Volo.Abp.FeatureManagement.Application" />

3
aspnet-core/modules/DataDictionaryManagement/host/Lion.AbpPro.DataDictionaryManagement.HttpApi.Host/DataDictionaryManagementHttpApiHostModule.cs

@ -17,7 +17,6 @@ namespace Lion.AbpPro.DataDictionaryManagement
typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreSerilogModule), typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpProAspNetCoreModule) typeof(AbpProAspNetCoreModule)
)] )]
public class DataDictionaryManagementHttpApiHostModule : AbpModule public class DataDictionaryManagementHttpApiHostModule : AbpModule
@ -54,7 +53,7 @@ namespace Lion.AbpPro.DataDictionaryManagement
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseAuthorization(); app.UseAuthorization();
app.UseSwagger(); app.UseSwagger();
app.UseAbpSwaggerUI(options => app.UseSwaggerUI(options =>
{ {
options.SwaggerEndpoint("/swagger/DataDictionaryManagement/swagger.json", "DataDictionaryManagement API"); options.SwaggerEndpoint("/swagger/DataDictionaryManagement/swagger.json", "DataDictionaryManagement API");
options.DocExpansion(DocExpansion.None); options.DocExpansion(DocExpansion.None);

1
aspnet-core/modules/DataDictionaryManagement/host/Lion.AbpPro.DataDictionaryManagement.HttpApi.Host/GlobalUsings.cs

@ -33,5 +33,4 @@ global using Volo.Abp.Localization;
global using Volo.Abp.Modularity; global using Volo.Abp.Modularity;
global using Volo.Abp.PermissionManagement.EntityFrameworkCore; global using Volo.Abp.PermissionManagement.EntityFrameworkCore;
global using Volo.Abp.SettingManagement.EntityFrameworkCore; global using Volo.Abp.SettingManagement.EntityFrameworkCore;
global using Volo.Abp.Swashbuckle;
global using Volo.Abp.VirtualFileSystem; global using Volo.Abp.VirtualFileSystem;

1
aspnet-core/modules/DataDictionaryManagement/host/Lion.AbpPro.DataDictionaryManagement.HttpApi.Host/Lion.AbpPro.DataDictionaryManagement.HttpApi.Host.csproj

@ -18,7 +18,6 @@
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" /> <PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Swashbuckle" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" />

4
aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/FileManagementHttpApiHostModule.cs

@ -10,7 +10,7 @@ namespace Lion.AbpPro.FileManagement;
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpCachingStackExchangeRedisModule), typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreSerilogModule), typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpEntityFrameworkCorePostgreSqlModule), typeof(AbpEntityFrameworkCorePostgreSqlModule),
typeof(AbpProAspNetCoreModule) typeof(AbpProAspNetCoreModule)
)] )]
@ -48,7 +48,7 @@ public class FileManagementHttpApiHostModule : AbpModule
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseAuthorization(); app.UseAuthorization();
app.UseSwagger(); app.UseSwagger();
app.UseAbpSwaggerUI(options => app.UseSwaggerUI(options =>
{ {
options.SwaggerEndpoint("/swagger/FileManagement/swagger.json", "FileManagement API"); options.SwaggerEndpoint("/swagger/FileManagement/swagger.json", "FileManagement API");
options.DocExpansion(DocExpansion.None); options.DocExpansion(DocExpansion.None);

2
aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/GlobalUsings.cs

@ -28,5 +28,5 @@ global using Volo.Abp.Caching.StackExchangeRedis;
global using Volo.Abp.EntityFrameworkCore; global using Volo.Abp.EntityFrameworkCore;
global using Volo.Abp.Localization; global using Volo.Abp.Localization;
global using Volo.Abp.Modularity; global using Volo.Abp.Modularity;
global using Volo.Abp.Swashbuckle;
global using Volo.Abp.VirtualFileSystem; global using Volo.Abp.VirtualFileSystem;

1
aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Lion.AbpPro.FileManagement.HttpApi.Host.csproj

@ -27,7 +27,6 @@
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" /> <PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" /> <PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Swashbuckle" />
<PackageReference Include="Swashbuckle.AspNetCore" /> <PackageReference Include="Swashbuckle.AspNetCore" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" /> <PackageReference Include="Swashbuckle.AspNetCore.Annotations" />
</ItemGroup> </ItemGroup>

2
aspnet-core/modules/LanguageManagement/host/Lion.AbpPro.LanguageManagement.HttpApi.Host/GlobalUsings.cs

@ -33,5 +33,5 @@ global using Volo.Abp.Localization;
global using Volo.Abp.Modularity; global using Volo.Abp.Modularity;
global using Volo.Abp.PermissionManagement.EntityFrameworkCore; global using Volo.Abp.PermissionManagement.EntityFrameworkCore;
global using Volo.Abp.SettingManagement.EntityFrameworkCore; global using Volo.Abp.SettingManagement.EntityFrameworkCore;
global using Volo.Abp.Swashbuckle;
global using Volo.Abp.VirtualFileSystem; global using Volo.Abp.VirtualFileSystem;

4
aspnet-core/modules/LanguageManagement/host/Lion.AbpPro.LanguageManagement.HttpApi.Host/LanguageManagementHttpApiHostModule.cs

@ -16,7 +16,7 @@ namespace Lion.AbpPro.LanguageManagement
typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreSerilogModule), typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpProAspNetCoreModule) typeof(AbpProAspNetCoreModule)
)] )]
public class LanguageManagementHttpApiHostModule : AbpModule public class LanguageManagementHttpApiHostModule : AbpModule
@ -53,7 +53,7 @@ namespace Lion.AbpPro.LanguageManagement
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseAuthorization(); app.UseAuthorization();
app.UseSwagger(); app.UseSwagger();
app.UseAbpSwaggerUI(options => app.UseSwaggerUI(options =>
{ {
options.SwaggerEndpoint("/swagger/LanguageManagement/swagger.json", "LanguageManagement API"); options.SwaggerEndpoint("/swagger/LanguageManagement/swagger.json", "LanguageManagement API");
options.DocExpansion(DocExpansion.None); options.DocExpansion(DocExpansion.None);

1
aspnet-core/modules/LanguageManagement/host/Lion.AbpPro.LanguageManagement.HttpApi.Host/Lion.AbpPro.LanguageManagement.HttpApi.Host.csproj

@ -19,7 +19,6 @@
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" /> <PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Swashbuckle" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" />

2
aspnet-core/modules/NotificationManagement/host/Lion.AbpPro.NotificationManagement.HttpApi.Host/GlobalUsings.cs

@ -25,5 +25,5 @@ global using Volo.Abp.Caching.StackExchangeRedis;
global using Volo.Abp.EntityFrameworkCore; global using Volo.Abp.EntityFrameworkCore;
global using Volo.Abp.Localization; global using Volo.Abp.Localization;
global using Volo.Abp.Modularity; global using Volo.Abp.Modularity;
global using Volo.Abp.Swashbuckle;
global using Volo.Abp.VirtualFileSystem; global using Volo.Abp.VirtualFileSystem;

1
aspnet-core/modules/NotificationManagement/host/Lion.AbpPro.NotificationManagement.HttpApi.Host/Lion.AbpPro.NotificationManagement.HttpApi.Host.csproj

@ -25,7 +25,6 @@
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis"/> <PackageReference Include="Volo.Abp.Caching.StackExchangeRedis"/>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy"/> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy"/>
<PackageReference Include="Volo.Abp.AspNetCore.Serilog"/> <PackageReference Include="Volo.Abp.AspNetCore.Serilog"/>
<PackageReference Include="Volo.Abp.Swashbuckle"/>
<PackageReference Include="Swashbuckle.AspNetCore"/> <PackageReference Include="Swashbuckle.AspNetCore"/>
<PackageReference Include="Swashbuckle.AspNetCore.Annotations"/> <PackageReference Include="Swashbuckle.AspNetCore.Annotations"/>
</ItemGroup> </ItemGroup>

4
aspnet-core/modules/NotificationManagement/host/Lion.AbpPro.NotificationManagement.HttpApi.Host/NotificationManagementHttpApiHostModule.cs

@ -10,7 +10,7 @@ namespace Lion.AbpPro.NotificationManagement;
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpCachingStackExchangeRedisModule), typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreSerilogModule), typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpProCapModule), typeof(AbpProCapModule),
typeof(AbpEntityFrameworkCorePostgreSqlModule), typeof(AbpEntityFrameworkCorePostgreSqlModule),
typeof(AbpProAspNetCoreModule) typeof(AbpProAspNetCoreModule)
@ -49,7 +49,7 @@ public class NotificationManagementHttpApiHostModule : AbpModule
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseAuthorization(); app.UseAuthorization();
app.UseSwagger(); app.UseSwagger();
app.UseAbpSwaggerUI(options => app.UseSwaggerUI(options =>
{ {
options.SwaggerEndpoint("/swagger/NotificationManagement/swagger.json", "NotificationManagement API"); options.SwaggerEndpoint("/swagger/NotificationManagement/swagger.json", "NotificationManagement API");
options.DocExpansion(DocExpansion.None); options.DocExpansion(DocExpansion.None);

11
aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs

@ -15,8 +15,7 @@ namespace Lion.AbpPro;
typeof(AbpCachingStackExchangeRedisModule), typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpDistributedLockingModule), typeof(AbpDistributedLockingModule),
typeof(AbpBlobStoringFileSystemModule), typeof(AbpBlobStoringFileSystemModule),
typeof(AbpProStarterModule), typeof(AbpProStarterModule)
typeof(AbpSwashbuckleModule)
//typeof(AbpBackgroundJobsHangfireModule) //typeof(AbpBackgroundJobsHangfireModule)
)] )]
public partial class AbpProHttpApiHostModule : AbpModule public partial class AbpProHttpApiHostModule : AbpModule
@ -29,6 +28,7 @@ public partial class AbpProHttpApiHostModule : AbpModule
// options.ConventionalControllers.Create(typeof(AbpProApplicationModule).Assembly); // options.ConventionalControllers.Create(typeof(AbpProApplicationModule).Assembly);
// }); // });
} }
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
context.Services context.Services
@ -64,20 +64,19 @@ public partial class AbpProHttpApiHostModule : AbpModule
app.UseAuthentication(); app.UseAuthentication();
app.UseAbpProMultiTenancy(); app.UseAbpProMultiTenancy();
app.UseAuthorization(); app.UseAuthorization();
app.UseAbpProSwaggerUI("/swagger/AbpPro/swagger.json","AbpPro"); app.UseAbpProSwaggerUI("/swagger/AbpPro/swagger.json", "AbpPro");
app.UseAbpProAuditing(); app.UseAbpProAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseUnitOfWork(); app.UseUnitOfWork();
app.UseConfiguredEndpoints(endpoints => app.UseConfiguredEndpoints(endpoints =>
{ {
endpoints.MapHealthChecks("/health"); endpoints.MapHealthChecks("/health");
// endpoints.MapHangfireDashboard("/hangfire", new DashboardOptions() // endpoints.MapHangfireDashboard("/hangfire", new DashboardOptions()
// { // {
// Authorization = new[] { new CustomHangfireAuthorizeFilter() }, // Authorization = new[] { new CustomHangfireAuthorizeFilter() },
// IgnoreAntiforgeryToken = true // IgnoreAntiforgeryToken = true
// }); // });
}); });
app.UseAbpProConsul(); app.UseAbpProConsul();
} }

1
aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/GlobalUsings.cs

@ -77,6 +77,5 @@ global using Volo.Abp.Json;
global using Volo.Abp.Localization; global using Volo.Abp.Localization;
global using Volo.Abp.Modularity; global using Volo.Abp.Modularity;
global using Volo.Abp.MultiTenancy; global using Volo.Abp.MultiTenancy;
global using Volo.Abp.Swashbuckle;
global using Volo.Abp.Users; global using Volo.Abp.Users;
global using Volo.Abp.Validation; global using Volo.Abp.Validation;

1
aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Lion.AbpPro.HttpApi.Host.csproj

@ -13,7 +13,6 @@
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy"/> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy"/>
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis"/> <PackageReference Include="Volo.Abp.Caching.StackExchangeRedis"/>
<PackageReference Include="Volo.Abp.AspNetCore.Serilog"/> <PackageReference Include="Volo.Abp.AspNetCore.Serilog"/>
<PackageReference Include="Volo.Abp.Swashbuckle"/>
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer"/> <PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer"/>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic"/> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic"/>
<PackageReference Include="Volo.Abp.DistributedLocking"/> <PackageReference Include="Volo.Abp.DistributedLocking"/>

Loading…
Cancel
Save