新增SwaggerDemo
This commit is contained in:
39
电子展板/Utility/Swagger/SwaggerCommentAttribute.cs
Normal file
39
电子展板/Utility/Swagger/SwaggerCommentAttribute.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace 电子展板.Utility.Swagger
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class SwaggerCommentAttribute : Attribute
|
||||
{
|
||||
public string Comment { get; set; }
|
||||
public bool? IsRequired { get; set; }
|
||||
|
||||
public long? Min { get; set; }
|
||||
public long? Max { get; set; }
|
||||
public SwaggerCommentAttribute()
|
||||
{
|
||||
Comment = "";
|
||||
}
|
||||
public SwaggerCommentAttribute(string comment)
|
||||
{
|
||||
Comment = comment;
|
||||
}
|
||||
public SwaggerCommentAttribute(string comment, bool isRequired)
|
||||
{
|
||||
Comment = comment;
|
||||
IsRequired = isRequired;
|
||||
}
|
||||
public SwaggerCommentAttribute(string comment, bool isRequired, long min, long max)
|
||||
{
|
||||
Comment = comment;
|
||||
IsRequired = isRequired;
|
||||
Min = min;
|
||||
Max = max;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user