package com.jay.monitor.data.server.report;

import com.jay.monitor.data.core.model.serializable.base.BaseDTO;
import com.jay.monitor.data.core.model.serializable.base.CommonDataDTO;
import com.jay.monitor.data.server.report.alert.rule.ConfigAlertRule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Module 告警模块
 * @Description 实时告警模块
 * @Author liukaixiong
 * @Date 2021/1/14 10:35
 */
@Component
public class RealtimeAlertProcess {

    @Autowired
    private ConfigAlertRule configAlertRule;

    private Logger logger = LoggerFactory.getLogger(getClass());

    /**
     * 批量数据验证
     *
     * @param baseDTOList
     */
    public void process(List<? extends BaseDTO> baseDTOList) {
        for (int i = 0; i < baseDTOList.size(); i++) {
            BaseDTO baseDTO = baseDTOList.get(i);
            configAlertRule.alert((CommonDataDTO)baseDTO);
        }
    }

}
