package com.zksy.WaterSupply.MonitorAlarm.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 供水监测报警审核记录实体
 */
@Data
@TableName(value = "alarm_audit", schema = "app_user")
@ApiModel(
        value = "AlarmAudit",
        description = "报警审核记录，包含报警审核/解除操作、意见、附件及全流程跟踪所需字段"
)
public class AlarmAudit implements Serializable {

    @ApiModelProperty(
            value = "审核记录ID",
            example = "1",
            position = 1,
            notes = "数据库自增主键，新增时不需要传入"
    )
    @TableId(type = IdType.AUTO)
    private Long auditId;

    @ApiModelProperty(
            value = "关联报警ID",
            example = "uuid",
            required = true,
            position = 2
    )
    private String alarmId;

    @ApiModelProperty(
            value = "审核动作",
            example = "1",
            required = true,
            allowableValues = "1,2",
            position = 3,
            notes = "1-审核 2-解除"
    )
    private Integer auditAction;

    @ApiModelProperty(
            value = "审核结果",
            example = "1",
            required = true,
            allowableValues = "1,2",
            position = 4,
            notes = "1-属实/审核通过 2-误报/解除报警"
    )
    private Integer auditResult;

    @ApiModelProperty(
            value = "审核/解除意见",
            example = "现场核实确为管网压力异常，同意派发工单处理",
            position = 5
    )
    private String auditOpinion;

    @ApiModelProperty(
            value = "附件地址（多个用逗号分隔）",
            example = "https://xx/upload/a.jpg,https://xx/upload/b.jpg",
            position = 6
    )
    private String attachUrl;

    @ApiModelProperty(
            value = "操作人ID",
            example = "1",
            hidden = true,
            position = 7
    )
    private Long auditUserId;

    @ApiModelProperty(
            value = "操作人姓名",
            example = "admin",
            hidden = true,
            position = 8
    )
    private String auditUserName;

    @ApiModelProperty(
            value = "操作时间",
            example = "2026-08-11 10:00:00",
            position = 9
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime auditTime;

    @ApiModelProperty(
            value = "创建时间",
            example = "2026-08-11 10:00:00",
            hidden = true,
            position = 10
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @ApiModelProperty(
            value = "更新时间",
            example = "2026-08-11 10:00:00",
            hidden = true,
            position = 11
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
