Files
simapi-net/Attributes/SimApiDocAttribute.cs
T

25 lines
743 B
C#
Raw Normal View History

2020-02-18 06:37:48 +08:00
using System;
using Swashbuckle.AspNetCore.Annotations;
2019-12-23 16:32:06 +08:00
2020-08-05 15:29:56 +08:00
namespace SimApi.Attributes
2019-12-23 16:32:06 +08:00
{
/// <summary>
/// 快捷自定义接口文档类
/// </summary>
2020-02-18 06:37:48 +08:00
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
2020-08-05 15:29:56 +08:00
public class SimApiDocAttribute : SwaggerOperationAttribute
2019-12-23 16:32:06 +08:00
{
/// <summary>
/// 定义接口说明
/// </summary>
/// <param name="tag">接口分组</param>
/// <param name="name">接口名称</param>
2020-08-05 15:29:56 +08:00
public SimApiDocAttribute(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"};
}
}
}