package com.tofly.em;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;

/**
 * 文件/数据表 类型
 *
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum FileTableEnum {
    /**
     * 厂站基本信息
     */
    tf_ywpn_monitor_stationsiteinfo_w("TF_YWPN_STATIONSITEINFO_W","stationsiteinfoService"),
    /**
     * 泵站信息管理
     */
    tf_monitor_pump_station_w("TF_MONITOR_PUMP_STATION_W","tfMonitorPumpStationWService"),
    /**
     * 设备信息管理
     */
    tf_ywpn_monitor_device_w("TF_DEVICE_ARCHIVE_MANAGE","deviceArchiveManageService"),
    ;

    /**
     * 内容
     */
    private String tableName;

    /**
     * 注入服务名称
     */
    private String injectionServerType;

    public static String getCodeForValue(String tableName) {
        String path = "";
        if (StringUtils.isEmpty(tableName)) {
            return path;
        }

        for (FileTableEnum e : FileTableEnum.values()) {
            if (e.tableName.equalsIgnoreCase(tableName)) {
                path = e.injectionServerType;
                break;
            }
        }
        return path;
    }

}
