package com.erp.audit.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.Builder;
import java.time.LocalDateTime;

/**
 * 敏感操作规则配置
 */
@Data
@Builder
@TableName("sensitive_operation_rule")
public class SensitiveOperationRule {

    @TableId(type = IdType.AUTO)
    private Long id;

    /** 规则名称 */
    private String ruleName;

    /** 规则编码 */
    private String ruleCode;

    /** 模块 */
    private String module;

    /** 操作类型 */
    private String operationType;

    /** URL匹配规则 */
    private String urlPattern;

    /** 参数匹配规则(JSON) */
    private String paramPattern;

    /** 告警级别：LOW/MEDIUM/HIGH/CRITICAL */
    private String alertLevel;

    /** 是否启用 */
    private Boolean enabled;

    /** 告警通知方式：SMS/EMAIL/WEBHOOK/ROCKETMQ */
    private String notifyChannels;

    /** 告警通知人 */
    private String notifyUsers;

    /** 连续触发次数阈值 */
    private Integer triggerThreshold;

    /** 时间窗口(分钟) */
    private Integer timeWindowMinutes;

    /** 创建时间 */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /** 更新时间 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    /** 备注 */
    private String remark;
}
