namespace QYZH.InteractiveMagazine.Infrastructure.Middleware;
///
/// 操作日志标记
///
[AttributeUsage(AttributeTargets.Method)]
public sealed class OperationLogAttribute : Attribute
{
///
/// 构造函数
///
/// 操作类型
/// 目标类型
public OperationLogAttribute(string actionType, string targetType)
{
ActionType = actionType;
TargetType = targetType;
}
///
/// 操作类型
///
public string ActionType { get; }
///
/// 目标类型
///
public string TargetType { get; }
///
/// 目标Id路由键
///
public string? TargetIdRouteKey { get; set; } = "id";
///
/// 目标Id参数名
///
public string? TargetIdArgumentName { get; set; }
///
/// 目标名称参数名
///
public string? TargetNameArgumentName { get; set; }
///
/// 目标名称属性名
///
public string? TargetNameProperty { get; set; }
///
/// 使用当前操作人Id作为目标Id
///
public bool UseOperatorAsTargetId { get; set; }
///
/// 是否记录参数摘要
///
public bool LogArguments { get; set; } = true;
}