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

import com.alipay.remoting.BizContext;
import com.jay.monitor.data.core.enums.MsgTypeEnums;
import com.jay.monitor.data.core.model.serializable.base.BaseDTO;
import com.jay.monitor.data.core.model.serializable.SQLMonitorDTO;
import com.jay.monitor.data.server.store.StoreDataManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 默认的用户处理器
 *
 * @author ： liukx
 * @time ： 2020/8/26 - 19:26
 */
@Component
public class SQLUserProcess extends AbstractUserProcess<BaseDTO> {
    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private StoreDataManager storeDataManager;

    @Override
    public Object handleRequest0(BizContext bizCtx, BaseDTO request) throws Exception {
        return storeDataManager.store(MsgTypeEnums.SQL, request);
    }

    @Override
    public List<String> multiInterest() {
        return getNamesList(SQLMonitorDTO.class);
    }

}
