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

import com.jay.monitor.data.core.enums.MonitorDataConstants;
import com.jay.monitor.data.core.enums.MsgTypeEnums;
import com.jay.monitor.data.core.model.serializable.ServiceDataDTO;
import com.jay.monitor.data.server.models.entity.es.JayMonitorServiceIndex;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;

/**
 * 描述: 业务埋点存储器
 *
 * @author liukx
 * @date 2021/9/26 10:35
 */
public class ElasticServiceStoreProcess
    extends AbstractElasticSearchStoreProcess<ServiceDataDTO, JayMonitorServiceIndex> {

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

    @Override
    public String tableName() {
        return MonitorDataConstants.ES_SERVICE_STORE;
    }

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

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

}
