Browse Source

分组

master
wxd 11 months ago
parent
commit
6da6e04afd
  1. 2
      src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs
  2. 2
      src/Shentun.Pacs.Application/Worklists/WorklistAppService.cs
  3. 59
      src/Shentun.Pacs.HttpApi.Host/PeisHttpApiHostModule.cs

2
src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs

@ -36,7 +36,7 @@ namespace Shentun.Pacs.PacsBusiness
/// <summary> /// <summary>
/// pacs相关接口 免登录 /// pacs相关接口 免登录
/// </summary> /// </summary>
[ApiExplorerSettings(GroupName = "Work")]
[ApiExplorerSettings(GroupName = "Pacs")]
public class PacsBusinessAppService : ApplicationService public class PacsBusinessAppService : ApplicationService
{ {

2
src/Shentun.Pacs.Application/Worklists/WorklistAppService.cs

@ -12,7 +12,7 @@ using Volo.Abp.Domain.Repositories;
namespace Shentun.Pacs.Worklists namespace Shentun.Pacs.Worklists
{ {
[ApiExplorerSettings(GroupName = "Work")]
[ApiExplorerSettings(GroupName = "Pacs")]
[Authorize] [Authorize]
public class WorklistAppService : ApplicationService public class WorklistAppService : ApplicationService
{ {

59
src/Shentun.Pacs.HttpApi.Host/PeisHttpApiHostModule.cs

@ -84,8 +84,7 @@ namespace Shentun.Pacs;
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpAccountWebOpenIddictModule), typeof(AbpAccountWebOpenIddictModule),
typeof(AbpAspNetCoreSerilogModule), typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpBackgroundWorkersHangfireModule)
typeof(AbpSwashbuckleModule)
)] )]
public class PeisHttpApiHostModule : AbpModule public class PeisHttpApiHostModule : AbpModule
{ {
@ -361,10 +360,7 @@ public class PeisHttpApiHostModule : AbpModule
}, },
options => options =>
{ {
//options.SwaggerDoc("v1", new OpenApiInfo { Title = "Peis API", Version = "v1" });
//options.DocInclusionPredicate((docName, description) => true);
//options.CustomSchemaIds(type => type.FullName);
options.SwaggerDoc("Pacs", new OpenApiInfo { Title = "Pacs业务Api", Version = "V1", Description = "Pacs业务Api" });
options.SwaggerDoc("Work", new OpenApiInfo { Title = "业务API", Version = "V1", Description = "业务API" }); options.SwaggerDoc("Work", new OpenApiInfo { Title = "业务API", Version = "V1", Description = "业务API" });
options.SwaggerDoc("Sys", new OpenApiInfo { Title = "底层API", Version = "V1", Description = "底层API" }); options.SwaggerDoc("Sys", new OpenApiInfo { Title = "底层API", Version = "V1", Description = "底层API" });
@ -460,19 +456,9 @@ public class PeisHttpApiHostModule : AbpModule
//添加swagger中文注释 //添加swagger中文注释
context.Services.AddSwaggerGen(options => context.Services.AddSwaggerGen(options =>
{
//var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
{
var baseDirectory = AppContext.BaseDirectory; var baseDirectory = AppContext.BaseDirectory;
//Serilog.Log.Information("swagger地址1:" + baseDirectory);
//var baseDirectory2 = Path.GetDirectoryName(typeof(Program).Assembly.Location);
//Serilog.Log.Information("swagger地址2:" + baseDirectory2);
//var baseDirectory3 = AppDomain.CurrentDomain.BaseDirectory;
//Serilog.Log.Information("swagger地址3:" + baseDirectory3);
var commentsFile = Path.Combine(baseDirectory, "Shentun.Pacs.Application.xml"); var commentsFile = Path.Combine(baseDirectory, "Shentun.Pacs.Application.xml");
options.IncludeXmlComments(commentsFile, true); options.IncludeXmlComments(commentsFile, true);
@ -514,18 +500,7 @@ public class PeisHttpApiHostModule : AbpModule
app.UseCorrelationId(); app.UseCorrelationId();
//var staticFile = new StaticFileOptions();
//var filePath = env.ContentRootPath+"UpLoad\\";
////var filePath = env.ContentRootPath ;
//staticFile.FileProvider = new PhysicalFileProvider(filePath);
//app.UseStaticFiles(new StaticFileOptions
//{
// FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "UpLoad")),
// RequestPath="/UpLoad"
//});
app.UseStaticFiles(); app.UseStaticFiles();
app.UseStaticFiles(new StaticFileOptions app.UseStaticFiles(new StaticFileOptions
@ -534,23 +509,7 @@ public class PeisHttpApiHostModule : AbpModule
RequestPath = "/ReportFile" RequestPath = "/ReportFile"
}); });
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "photo")),
RequestPath = "/photo"
});
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "UserPhoto")),
RequestPath = "/UserPhoto"
});
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "UserSign")),
RequestPath = "/UserSign"
});
//虚拟目录 //虚拟目录
@ -593,13 +552,11 @@ public class PeisHttpApiHostModule : AbpModule
app.UseSwagger(); app.UseSwagger();
app.UseAbpSwaggerUI(c => app.UseAbpSwaggerUI(c =>
{ {
//c.SwaggerEndpoint("/swagger/v1/swagger.json", "Peis API");
c.SwaggerEndpoint($"/swagger/Pacs/swagger.json", "Pacs业务Api"); //分组显示
c.SwaggerEndpoint($"/swagger/Work/swagger.json", "业务API"); //分组显示 c.SwaggerEndpoint($"/swagger/Work/swagger.json", "业务API"); //分组显示
c.SwaggerEndpoint($"/swagger/Sys/swagger.json", "底层API"); //分组显示 c.SwaggerEndpoint($"/swagger/Sys/swagger.json", "底层API"); //分组显示
//c.RoutePrefix = string.Empty; // url 中不显示swagger
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>(); var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
c.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); c.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);

Loading…
Cancel
Save