package com.haha.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@TableName("t_device_alert_record")
public class DeviceAlertRecord implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 设备编号
     */
    private String deviceId;

    /**
     * 所属门店ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long shopId;

    /**
     * 设备名称
     */
    private String deviceName;

    /**
     * 告警类型：1-离线, 2-信号弱, 3-恢复上线
     */
    private Integer alertType;

    /**
     * 告警级别：1-普通, 2-紧急
     */
    private Integer alertLevel;

    /**
     * 告警内容描述
     */
    private String alertContent;

    /**
     * 信号值（如有）
     */
    private Integer signalValue;

    /**
     * 延迟值（如有）
     */
    private Integer pingValue;

    /**
     * 通知状态：0-未发送, 1-已发送, 2-发送失败
     */
    private Integer notifyStatus;

    /**
     * 通知渠道：WECHAT_WORK
     */
    private String notifyChannel;

    /**
     * 触发来源：CALLBACK / SCHEDULED_SCAN
     */
    private String triggerSource;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime alertTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime createTime;
}
