Files
simapi-net/Attributes/SimApiDocAttribute.cs
T

24 lines
664 B
C#
Raw Normal View History

2024-03-23 07:29:43 +08:00
using System;
2020-02-18 06:37:48 +08:00
using Swashbuckle.AspNetCore.Annotations;
2019-12-23 16:32:06 +08:00
2024-03-23 07:29:43 +08:00
namespace SimApi.Attributes;
/// <summary>
/// 快捷自定义接口文档类
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
public class SimApiDocAttribute : SwaggerOperationAttribute
2019-12-23 16:32:06 +08:00
{
/// <summary>
2024-03-23 07:29:43 +08:00
/// 定义接口说明
2019-12-23 16:32:06 +08:00
/// </summary>
2024-03-23 07:29:43 +08:00
/// <param name="tag">接口分组</param>
/// <param name="name">接口名称</param>
public SimApiDocAttribute(string tag, string name)
2019-12-23 16:32:06 +08:00
{
2024-03-23 07:29:43 +08:00
Tags = new[] { tag };
Summary = name;
// Consumes = new[] {"application/json"};
// Produces = new[] {"application/json"};
2019-12-23 16:32:06 +08:00
}
}