|
@@ -13,6 +13,8 @@ using Quartz;
|
|
|
using Quartz.Impl;
|
|
|
using Sugar.Enties;
|
|
|
using System;
|
|
|
+using System.IO;
|
|
|
+using System.Reflection;
|
|
|
using Utils;
|
|
|
using Utils.Jwt;
|
|
|
|
|
@@ -38,7 +40,7 @@ namespace PMS.NetCore
|
|
|
services.AddSingleton<ISchedulerFactory, StdSchedulerFactory>();
|
|
|
|
|
|
// TODO create options classes for app settings
|
|
|
- var identityConn = AppSettingsHelper.Configuration["Logging:AppSettings:ConnectionString"];
|
|
|
+ var identityConn = AppSettingsHelper.Configuration["AppSettings:ConnectionString"];
|
|
|
|
|
|
//identityConn = identityConn.Replace(CONTENTROOTPATHTOKEN, _env.ContentRootPath);
|
|
|
|
|
@@ -90,12 +92,19 @@ namespace PMS.NetCore
|
|
|
services.AddSingleton<IConfiguration>(Configuration);
|
|
|
services.AddSingleton<ICaching, Caching>();
|
|
|
|
|
|
- services.AddControllers();
|
|
|
+
|
|
|
services.AddSwaggerGen(c =>
|
|
|
{
|
|
|
c.SwaggerDoc("v1", new OpenApiInfo { Title = "PMS.NetCore API——Net5.0", Version = "v1" });
|
|
|
+ // 为 Swagger 设置xml文档注释路径
|
|
|
+ var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
|
|
+ var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
|
|
|
+ // 添加控制器层注释,true表示显示控制器注释
|
|
|
+ c.IncludeXmlComments(xmlPath, true);
|
|
|
|
|
|
});
|
|
|
+ services.AddControllers();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|