2022-09-29 17:02:34 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc.Filters;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Yi.Framework.Common.Const;
|
|
|
|
|
|
using Yi.Framework.Common.Enum;
|
|
|
|
|
|
|
2022-10-09 17:32:44 +08:00
|
|
|
|
namespace Yi.Framework.Common.Attribute
|
2022-09-29 17:02:34 +08:00
|
|
|
|
{
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Method)]
|
2022-10-09 17:32:44 +08:00
|
|
|
|
public class LogAttribute : System.Attribute
|
2022-09-29 17:02:34 +08:00
|
|
|
|
{
|
2022-10-01 23:53:43 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 操作类型
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public OperEnum OperType { get; set; }
|
2022-09-29 17:02:34 +08:00
|
|
|
|
|
2022-10-01 23:53:43 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 日志标题(模块)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Title { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否保存请求数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsSaveRequestData { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否保存返回数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsSaveResponseData { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
|
|
public LogAttribute(string title, OperEnum operationType)
|
2022-09-29 17:02:34 +08:00
|
|
|
|
{
|
2022-10-01 23:53:43 +08:00
|
|
|
|
this.Title = title;
|
|
|
|
|
|
this.OperType = operationType;
|
2022-09-29 17:02:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|