package com.jay.monitor.data.server.store.es;

import com.jay.monitor.data.core.enums.MsgTypeEnums;
import com.jay.monitor.data.core.model.serializable.SQLMonitorDTO;
import com.jay.monitor.data.server.models.entity.es.JayMonitorSQLIndex;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

public class ElasticSQLStoreProcess extends AbstractElasticSearchStoreProcess<SQLMonitorDTO, JayMonitorSQLIndex> {
    private Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    public String tableName() {
        return "jay_monitor_sql";
    }

    @Override
    public MsgTypeEnums msgTypeEnums() {
        return MsgTypeEnums.SQL;
    }

    @Override
    protected JayMonitorSQLIndex builderJayMonitor(SQLMonitorDTO request) {
        JayMonitorSQLIndex index = new JayMonitorSQLIndex();
        BeanUtils.copyProperties(request, index);
        return index;
    }

}
