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. 7
      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.EntityFrameworkCore.PostgreSql" 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.Contracts" 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.Localization" Version="10.0.1" />
<PackageReference Update="Volo.Abp.DistributedLocking" Version="10.0.1" />
<PackageReference Update="Volo.Abp.Guids" Version="10.0.1" />
</ItemGroup>
</Project>

4
aspnet-core/Directory.Build.targets

@ -58,8 +58,8 @@
<!-- Swagger
<PackageReference Update="Swashbuckle.AspNetCore.SwaggerUI" Version="10.0.0"/> -->
<PackageReference Update="Swashbuckle.AspNetCore" Version="9.0.4"/>
<PackageReference Update="Swashbuckle.AspNetCore.Annotations" Version="9.0.4"/>
<PackageReference Update="Swashbuckle.AspNetCore" Version="10.0.1"/>
<PackageReference Update="Swashbuckle.AspNetCore.Annotations" Version="10.0.1"/>
<!-- Serilog 日志-->
<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.Localization;
global using Microsoft.AspNetCore.Http;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.AspNetCore.Mvc.Abstractions;
global using Microsoft.AspNetCore.Mvc.ApiExplorer;
global using Microsoft.EntityFrameworkCore;
@ -27,8 +26,6 @@ global using Microsoft.Extensions.Localization;
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Logging.Abstractions;
global using Microsoft.Extensions.Options;
global using Microsoft.OpenApi.Any;
global using Microsoft.OpenApi.Models;
global using Ocelot.Middleware;
global using Serilog.Exceptions;
global using Serilog.Sinks.Elasticsearch;
@ -36,7 +33,6 @@ global using Swashbuckle.AspNetCore.Swagger;
global using Swashbuckle.AspNetCore.SwaggerGen;
global using Volo.Abp.AspNetCore.ExceptionHandling;
global using Volo.Abp.AspNetCore.Mvc;
global using Volo.Abp.AspNetCore.Mvc.ExceptionHandling;
global using Volo.Abp.Authorization;
global using Volo.Abp.DependencyInjection;
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.Autofac" />
<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.Mvc" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" />
<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 Volo.Abp.Swashbuckle;
namespace Lion.AbpPro.AspNetCore;
//[DependsOn(typeof(AbpSwashbuckleModule))]
public class AbpProAspNetCoreModule : AbpModule
{
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;
if (!swaggerOptions.Enabled) return app;
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint(endpoint, name);
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;
[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.Options;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi;
using Swagger;
using Volo.Abp.AspNetCore.Auditing;
using Volo.Abp.AspNetCore.MultiTenancy;
@ -158,7 +160,7 @@ public static class ServiceCollectionExtensions
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.DocInclusionPredicate((docName, description) => true);
//options.EnableAnnotations(); // 启用注解
@ -181,21 +183,12 @@ public static class ServiceCollectionExtensions
Scheme = JwtBearerDefaults.AuthenticationScheme,
BearerFormat = "JWT"
});
options.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
new OpenApiSecurityScheme
{
Reference = new OpenApiReference
options.AddSecurityRequirement(document => new OpenApiSecurityRequirement()
{
Type = ReferenceType.SecurityScheme, Id = "Bearer"
}
},
new List<string>()
}
[new OpenApiSecuritySchemeReference("Bearer", document)] = []
});
options.AddSecurityDefinition("ApiKey", new OpenApiSecurityScheme()
options.AddSecurityDefinition("Accept-Language", new OpenApiSecurityScheme()
{
Type = SecuritySchemeType.ApiKey,
In = ParameterLocation.Header,
@ -203,17 +196,11 @@ public static class ServiceCollectionExtensions
Description = "多语言设置,系统预设语言有zh-Hans、en,默认为zh-Hans",
});
options.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
new OpenApiSecurityScheme
options.AddSecurityRequirement(document => new OpenApiSecurityRequirement()
{
Reference = new OpenApiReference
{ Type = ReferenceType.SecurityScheme, Id = "ApiKey" }
},
Array.Empty<string>()
}
[new OpenApiSecuritySchemeReference("Accept-Language", document)] = []
});
});
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>
/// 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;
/// <summary>
@ -6,16 +9,17 @@ namespace Swagger;
/// </summary>
public class EnumSchemaFilter : ISchemaFilter
{
public void Apply(OpenApiSchema schema, SchemaFilterContext context)
public void Apply(IOpenApiSchema schema, SchemaFilterContext context)
{
if (schema is OpenApiSchema openApiScheme && context.Type.IsEnum)
{
if (context.Type.IsEnum)
openApiScheme.Enum?.Clear();
openApiScheme.Type = JsonSchemaType.String;
openApiScheme.Format = null;
foreach (var name in Enum.GetNames(context.Type))
{
var array = new OpenApiArray();
array.AddRange(Enum.GetNames(context.Type).Select(n => new OpenApiString(n)));
// NSwag
schema.Extensions.Add("x-enumNames", array);
// 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;
/// <summary>
@ -8,14 +10,56 @@ public class HiddenAbpDefaultApiFilter : IDocumentFilter
{
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
// 首先收集需要移除的路径
var pathsToRemove = new List<string>();
foreach (ApiDescription apiDescription in context.ApiDescriptions)
{
if (apiDescription.TryGetMethodInfo(out MethodInfo method))
{
string key = "/" + apiDescription.RelativePath;
var reuslt = IsHidden(key);
if (reuslt) swaggerDoc.Paths.Remove(key);
var result = IsHidden(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);
}
}

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

@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="Mapster"/>
<PackageReference Include="Volo.Abp.Guids"/>
<ProjectReference Include="..\Lion.AbpPro.Localization\Lion.AbpPro.Localization.csproj"/>
</ItemGroup>
</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(AbpEntityFrameworkCorePostgreSqlModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpProAspNetCoreModule)
)]
public class BasicManagementHttpApiHostModule : AbpModule
@ -50,7 +50,7 @@ public class BasicManagementHttpApiHostModule : AbpModule
app.UseAbpRequestLocalization();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/BasicManagement/swagger.json", "BasicManagement API");
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.Localization;
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.EntityFrameworkCore.PostgreSql" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Swashbuckle" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.SettingManagement.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>
<PackageReference Include="Volo.Abp.Ddd.Application" />
<PackageReference Include="Volo.Abp.Account.Application" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" />
<PackageReference Include="Volo.Abp.Identity.Application" />
<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.TenantManagement.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(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpProAspNetCoreModule)
)]
public class DataDictionaryManagementHttpApiHostModule : AbpModule
@ -54,7 +53,7 @@ namespace Lion.AbpPro.DataDictionaryManagement
app.UseAbpRequestLocalization();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/DataDictionaryManagement/swagger.json", "DataDictionaryManagement API");
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.PermissionManagement.EntityFrameworkCore;
global using Volo.Abp.SettingManagement.EntityFrameworkCore;
global using Volo.Abp.Swashbuckle;
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.EntityFrameworkCore.PostgreSql" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Swashbuckle" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.SettingManagement.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(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpEntityFrameworkCorePostgreSqlModule),
typeof(AbpProAspNetCoreModule)
)]
@ -48,7 +48,7 @@ public class FileManagementHttpApiHostModule : AbpModule
app.UseAbpRequestLocalization();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/FileManagement/swagger.json", "FileManagement API");
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.Localization;
global using Volo.Abp.Modularity;
global using Volo.Abp.Swashbuckle;
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.AspNetCore.Mvc.UI.MultiTenancy" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Swashbuckle" />
<PackageReference Include="Swashbuckle.AspNetCore" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" />
</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.PermissionManagement.EntityFrameworkCore;
global using Volo.Abp.SettingManagement.EntityFrameworkCore;
global using Volo.Abp.Swashbuckle;
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(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpProAspNetCoreModule)
)]
public class LanguageManagementHttpApiHostModule : AbpModule
@ -53,7 +53,7 @@ namespace Lion.AbpPro.LanguageManagement
app.UseAbpRequestLocalization();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/LanguageManagement/swagger.json", "LanguageManagement API");
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.EntityFrameworkCore.PostgreSql" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Swashbuckle" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.SettingManagement.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.Localization;
global using Volo.Abp.Modularity;
global using Volo.Abp.Swashbuckle;
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.AspNetCore.Mvc.UI.MultiTenancy"/>
<PackageReference Include="Volo.Abp.AspNetCore.Serilog"/>
<PackageReference Include="Volo.Abp.Swashbuckle"/>
<PackageReference Include="Swashbuckle.AspNetCore"/>
<PackageReference Include="Swashbuckle.AspNetCore.Annotations"/>
</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(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpProCapModule),
typeof(AbpEntityFrameworkCorePostgreSqlModule),
typeof(AbpProAspNetCoreModule)
@ -49,7 +49,7 @@ public class NotificationManagementHttpApiHostModule : AbpModule
app.UseAbpRequestLocalization();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/NotificationManagement/swagger.json", "NotificationManagement API");
options.DocExpansion(DocExpansion.None);

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

@ -15,8 +15,7 @@ namespace Lion.AbpPro;
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpDistributedLockingModule),
typeof(AbpBlobStoringFileSystemModule),
typeof(AbpProStarterModule),
typeof(AbpSwashbuckleModule)
typeof(AbpProStarterModule)
//typeof(AbpBackgroundJobsHangfireModule)
)]
public partial class AbpProHttpApiHostModule : AbpModule
@ -29,6 +28,7 @@ public partial class AbpProHttpApiHostModule : AbpModule
// options.ConventionalControllers.Create(typeof(AbpProApplicationModule).Assembly);
// });
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services
@ -64,7 +64,7 @@ public partial class AbpProHttpApiHostModule : AbpModule
app.UseAuthentication();
app.UseAbpProMultiTenancy();
app.UseAuthorization();
app.UseAbpProSwaggerUI("/swagger/AbpPro/swagger.json","AbpPro");
app.UseAbpProSwaggerUI("/swagger/AbpPro/swagger.json", "AbpPro");
app.UseAbpProAuditing();
app.UseAbpSerilogEnrichers();
app.UseUnitOfWork();
@ -77,7 +77,6 @@ public partial class AbpProHttpApiHostModule : AbpModule
// Authorization = new[] { new CustomHangfireAuthorizeFilter() },
// IgnoreAntiforgeryToken = true
// });
});
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.Modularity;
global using Volo.Abp.MultiTenancy;
global using Volo.Abp.Swashbuckle;
global using Volo.Abp.Users;
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.Caching.StackExchangeRedis"/>
<PackageReference Include="Volo.Abp.AspNetCore.Serilog"/>
<PackageReference Include="Volo.Abp.Swashbuckle"/>
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer"/>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic"/>
<PackageReference Include="Volo.Abp.DistributedLocking"/>

Loading…
Cancel
Save