package com.jay.monitor.data.server.models.dto.alert;

import com.alibaba.fastjson.annotation.JSONField;
import com.jay.monitor.data.core.enums.MsgTypeEnums;
import com.jay.monitor.data.core.model.serializable.base.ApplicationData;
import com.jay.monitor.data.core.model.serializable.base.LogDataData;
import com.jay.monitor.data.core.model.serializable.base.RequestDataData;
import com.jay.monitor.data.core.model.serializable.base.SearchIndexData;
import com.jay.monitor.data.server.enums.AlertRuleEnums;

import java.util.Date;
import java.util.Map;

/**
 * @Module 告警模块
 * @JSONField 实时告警对象
 * @Author liukaixiong
 * @Date 2021/1/14 17:40
 */
public class RealTimeAlert implements ApplicationData, SearchIndexData, RequestDataData, LogDataData {

    @JSONField(name = "触发原因",ordinal = 1)
    private AlertRuleEnums triggerType;
    @JSONField(name = "触发总数",ordinal = 2)
    private Integer triggerCount;
    @JSONField(name = "监控类型",ordinal = 3)
    private MsgTypeEnums type;
    @JSONField(name = "服务名称",ordinal = 4)
    private String applicationName;
    @JSONField(name = "服务器ip",ordinal = 5)
    private String ip;
    @JSONField(name = "请求url",ordinal = 6)
    private String url;
    @JSONField(name = "用户编号",ordinal = 7)
    private String userId;
    @JSONField(name = "消息队列类型",ordinal = 8)
    private String mqType;
    @JSONField(name = "主题类型",ordinal = 9)
    private String topic;
    @JSONField(name = "消息编号",ordinal = 10)
    private String msgId;
    @JSONField(name = "组名称",ordinal = 11)
    private String groupName;
    @JSONField(name = "组key名称",ordinal = 12)
    private String groupKeyName;
    @JSONField(name = "数据编号",ordinal = 13)
    private String dataId;
    @JSONField(name = "状态",ordinal = 14)
    private Integer status;
    @JSONField(name = "错误信息",ordinal = 15)
    private String errorMessage;
    @JSONField(name = "请求时长",ordinal = 15)
    private Long requestTime;
    @JSONField(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss",ordinal = 16)
    private Date createDate;

    private transient Map<String,Object> extMap;

    private transient String errorStackTrace;

    private transient String logId;

    public Map<String, Object> getExtMap() {
        return extMap;
    }

    public void setExtMap(Map<String, Object> extMap) {
        this.extMap = extMap;
    }

    public String getErrorStackTrace() {
        return errorStackTrace;
    }

    public void setErrorStackTrace(String errorStackTrace) {
        this.errorStackTrace = errorStackTrace;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public Integer getTriggerCount() {
        return triggerCount;
    }

    public void setTriggerCount(Integer triggerCount) {
        this.triggerCount = triggerCount;
    }

    public AlertRuleEnums getTriggerType() {
        return triggerType;
    }

    public void setTriggerType(AlertRuleEnums triggerType) {
        this.triggerType = triggerType;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getMqType() {
        return mqType;
    }

    public void setMqType(String mqType) {
        this.mqType = mqType;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public MsgTypeEnums getType() {
        return type;
    }

    public void setType(MsgTypeEnums type) {
        this.type = type;
    }

    @Override
    public String getLogId() {
        return this.logId;
    }

    @Override
    public void setLogId(String logId) {
        this.logId = logId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String getIp() {
        return this.ip;
    }

    @Override
    public void setIp(String ip) {
        this.ip = ip;
    }

    @Override
    public String getApplicationName() {
        return this.applicationName;
    }

    @Override
    public void setApplicationName(String applicationName) {
        this.applicationName = applicationName;
    }

    @Override
    public Long getRequestTime() {
        return requestTime;
    }

    @Override
    public void setRequestTime(Long requestTime) {
        this.requestTime = requestTime;
    }

    @Override
    public String getGroupName() {
        return this.groupName;
    }

    @Override
    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    @Override
    public String getGroupKeyName() {
        return this.groupKeyName;
    }

    @Override
    public void setGroupKeyName(String groupKeyName) {
        this.groupKeyName = groupKeyName;
    }

    @Override
    public String getDataId() {
        return this.dataId;
    }

    @Override
    public void setDataId(String dataId) {
        this.dataId = dataId;
    }
}
