swagger新增查看Model注解
This commit is contained in:
parent
47c3e41eb1
commit
2ac2583d1e
1
.gitignore
vendored
1
.gitignore
vendored
@ -271,3 +271,4 @@ __pycache__/
|
|||||||
/ZR.Admin.WebApi/DataProtection
|
/ZR.Admin.WebApi/DataProtection
|
||||||
/Quartz.NET.WindowsService
|
/Quartz.NET.WindowsService
|
||||||
/ZRAdmin-vue
|
/ZRAdmin-vue
|
||||||
|
/ZR.Admin.WebApi/ZRModel.xml
|
||||||
|
|||||||
@ -38,7 +38,7 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
public static void AddSwaggerConfig(this IServiceCollection services)
|
public static void AddSwaggerConfig(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
if (services == null) throw new ArgumentNullException(nameof(services));
|
if (services == null) throw new ArgumentNullException(nameof(services));
|
||||||
//IWebHostEnvironment hostEnvironment = App.GetRequiredService<IWebHostEnvironment>();
|
IWebHostEnvironment hostEnvironment = App.GetRequiredService<IWebHostEnvironment>();
|
||||||
|
|
||||||
services.AddSwaggerGen(c =>
|
services.AddSwaggerGen(c =>
|
||||||
{
|
{
|
||||||
@ -50,8 +50,11 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
});
|
});
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var tempPath = hostEnvironment.ContentRootPath;
|
||||||
//添加文档注释
|
//添加文档注释
|
||||||
c.IncludeXmlComments("ZRAdmin.xml", true);
|
c.IncludeXmlComments(Path.Combine(tempPath, "ZRAdmin.xml"), true);
|
||||||
|
c.IncludeXmlComments(Path.Combine(tempPath, "ZRModel.xml"), true);
|
||||||
|
//c.IncludeXmlComments(Path.Combine(Directory.GetParent(tempPath).FullName, "ZR.Model", "ZRModel.xml"), true);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace ZR.Model
|
namespace ZR.Model
|
||||||
@ -10,6 +11,9 @@ namespace ZR.Model
|
|||||||
/// 当前页码
|
/// 当前页码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int PageNum { get; set; }
|
public int PageNum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 每页显示多少条
|
||||||
|
/// </summary>
|
||||||
public int PageSize { get; set; }
|
public int PageSize { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 总记录数
|
/// 总记录数
|
||||||
|
|||||||
@ -27,9 +27,9 @@ namespace ZR.Model.System
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string AuthorName { get; set; }
|
public string AuthorName { get; set; }
|
||||||
public long UserId { get; set; }
|
public long UserId { get; set; }
|
||||||
/// <summary>
|
///// <summary>
|
||||||
///
|
/////
|
||||||
/// </summary>
|
///// </summary>
|
||||||
//public string Type { get; set; }
|
//public string Type { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文章状态 1、发布 2、草稿
|
/// 文章状态 1、发布 2、草稿
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user