package com.jay.monitor.data.server.config.props;

import com.jay.monitor.data.core.enums.MsgTypeEnums;
import com.jay.monitor.data.server.enums.AlertMsgEnums;
import com.jay.monitor.data.server.enums.StoreType;
import com.jay.monitor.data.server.models.config.AlertConfigModel;
import com.jay.monitor.data.server.models.config.AlertRuleConfigModel;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;

/**
 * @Module 属性配置
 * @Description 告警配置
 * @Author liukaixiong
 * @Date 2020/12/22 16:09
 */
@ConfigurationProperties(prefix = "spring.alert")
public class AlertProperties {
    /**
     * 是否开启告警推送
     */
    private boolean isEnable = true;

    /**
     * 存储类型
     */
    private StoreType storeType = StoreType.LOCAL;

    /**
     * 推送类型
     */
    private Map<AlertMsgEnums, AlertConfigModel> alertType;

    /**
     * 规则配置
     */
    private Map<MsgTypeEnums, AlertRuleConfigModel> alertRuleConfigMap = new HashMap<>();

    /**
     * 告警间隔分钟
     */
    private Long alertIntervalMinutes;

    /**
     * 监控后台URL
     */
    private String logMonitorUrl;

    /**
     * 控制台URL
     */
    private String consoleUrl;

    /**
     * 当前服务外网地址
     */
    private String serverDomain;

    /**
     * 服务的日志展示页面
     */
    private String serverLogConsole;

    public String getServerLogConsole() {
        return serverLogConsole;
    }

    public Long getAlertIntervalMinutes() {
        return alertIntervalMinutes;
    }

    public void setAlertIntervalMinutes(Long alertIntervalMinutes) {
        this.alertIntervalMinutes = alertIntervalMinutes;
    }

    public void setServerLogConsole(String serverLogConsole) {
        this.serverLogConsole = serverLogConsole;
    }

    public String getServerDomain() {
        return serverDomain;
    }

    public void setServerDomain(String serverDomain) {
        this.serverDomain = serverDomain;
    }

    public StoreType getStoreType() {
        return storeType;
    }

    public void setStoreType(StoreType storeType) {
        this.storeType = storeType;
    }

    public String getConsoleUrl() {
        return consoleUrl;
    }

    public void setConsoleUrl(String consoleUrl) {
        this.consoleUrl = consoleUrl;
    }

    public String getLogMonitorUrl() {
        return logMonitorUrl;
    }

    public void setLogMonitorUrl(String logMonitorUrl) {
        this.logMonitorUrl = logMonitorUrl;
    }

    public boolean isEnable() {
        return isEnable;
    }

    public void setEnable(boolean enable) {
        isEnable = enable;
    }

    public Map<MsgTypeEnums, AlertRuleConfigModel> getAlertRuleConfigMap() {
        return alertRuleConfigMap;
    }

    public void setAlertRuleConfigMap(Map<MsgTypeEnums, AlertRuleConfigModel> alertRuleConfigMap) {
        this.alertRuleConfigMap = alertRuleConfigMap;
    }

    public Map<AlertMsgEnums, AlertConfigModel> getAlertType() {
        return alertType;
    }

    public void setAlertType(Map<AlertMsgEnums, AlertConfigModel> alertType) {
        this.alertType = alertType;
    }
}

