package com.hdkj.lt.bf.event;

import lombok.Getter;

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

/**
 * 线路重过载告警持续1小时 → 触发重构算法事件
 * <p>
 * SeSnapshotService.processFeederCurrent 检测到持续1h过载/重载后发布此事件，
 * 由 @Async 监听器异步调用同事的重构接口。
 * 同事接口仅需两个参数：feeder_id（问题线路）、point_time（持续1h的起始断面时刻）
 *
 * @author lsl
 * @since 2026-07-25
 */
@Getter
public class ReconTriggerEvent implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 告警事件ID（t_current_event / t_voltage_event） */
    private final Long eventId;

    /** 问题线路ID */
    private final String feederId;

    /** 馈线名称 */
    private final String feederName;

    /** 区县ID */
    private final String countyId;

    /** 变电站ID */
    private final String subsId;

    /** 告警类型（current_overload / current_heavy / voltage_over / voltage_under） */
    private final String alarmType;

    /** 持续1小时的那个起始断面时刻 */
    private final LocalDateTime pointTime;

    /** 触发时间 */
    private final LocalDateTime triggerTime;

    public ReconTriggerEvent(Long eventId, String feederId, String feederName,
                              String countyId, String subsId, String alarmType,
                              LocalDateTime pointTime, LocalDateTime triggerTime) {
        this.eventId = eventId;
        this.feederId = feederId;
        this.feederName = feederName;
        this.countyId = countyId;
        this.subsId = subsId;
        this.alarmType = alarmType;
        this.pointTime = pointTime;
        this.triggerTime = triggerTime;
    }
}
