新增SwaggerDemo

This commit is contained in:
2025-09-23 16:29:17 +08:00
parent dc42b56bf6
commit dad5b8fb89
27 changed files with 505 additions and 39 deletions

View 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;
}
}
}