优化代码生成

This commit is contained in:
不做码农
2021-12-06 12:54:53 +08:00
parent d2c63d552e
commit 0e70896fa4
8 changed files with 150 additions and 178 deletions

View File

@@ -27,11 +27,16 @@ namespace ZR.Admin.WebApi.Extensions
Version = "v1",
Description = "",
});
//if (CurrentEnvironment.IsDevelopment())
//{
//添加文档注释
c.IncludeXmlComments(Path.Combine(hostEnvironment.ContentRootPath, "ZRAdmin.xml"), true);
//}
try
{
//添加文档注释
c.IncludeXmlComments(Path.Combine(hostEnvironment.ContentRootPath, "ZRAdmin.xml"), true);
}
catch (Exception ex)
{
Console.WriteLine("swagger 文档加载失败" + ex.Message);
}
//参考文章http://www.zyiz.net/tech/detail-134965.html
//需要安装包Swashbuckle.AspNetCore.Filters
// 开启权限小锁 需要在对应的Action上添加[Authorize]才能看到