43 lines
906 B
C#
43 lines
906 B
C#
using System.ComponentModel;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace SJZY.Track.Application.Dtos.Demo
|
|
{
|
|
public class SwaggerDemoInput
|
|
{
|
|
/// <summary>
|
|
/// 年龄
|
|
/// </summary>
|
|
/// <example>18</example> 这里可以写一些初始值
|
|
public int Age { get; set; }
|
|
|
|
/// <summary>
|
|
/// 姓名
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// 性别(枚举的展示样例)
|
|
/// </summary>
|
|
public Gender Gender { get; set; }
|
|
|
|
/// <summary>
|
|
/// 隐藏属性
|
|
/// </summary>
|
|
[JsonIgnore]
|
|
public int MyProperty { get; set; }
|
|
}
|
|
|
|
public enum Gender
|
|
{
|
|
[Description("纯爷们")]
|
|
男 = 2,
|
|
|
|
[Description("大姑娘")]
|
|
女 = 5,
|
|
|
|
[Description("你憋问")]
|
|
未知 = 8
|
|
}
|
|
}
|