2019-12-23 16:32:06 +08:00
|
|
|
using Swashbuckle.AspNetCore.Annotations;
|
|
|
|
|
|
2020-02-04 16:51:15 +08:00
|
|
|
namespace YYApi.Attributes
|
2019-12-23 16:32:06 +08:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 快捷自定义接口文档类
|
|
|
|
|
/// </summary>
|
2020-02-04 16:51:15 +08:00
|
|
|
public class YYDocAttribute : SwaggerOperationAttribute
|
2019-12-23 16:32:06 +08:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 定义接口说明
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tag">接口分组</param>
|
|
|
|
|
/// <param name="name">接口名称</param>
|
2020-02-04 16:51:15 +08:00
|
|
|
public YYDocAttribute(string tag, string name)
|
2019-12-23 16:32:06 +08:00
|
|
|
{
|
2020-02-04 16:51:15 +08:00
|
|
|
Tags = new[] { tag };
|
2019-12-23 16:32:06 +08:00
|
|
|
Summary = name;
|
|
|
|
|
// Consumes = new[] {"application/json"};
|
|
|
|
|
// Produces = new[] {"application/json"};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|