package com.artfess.base.dataway;


import com.artfess.base.util.AppUtil;
import net.hasor.dataql.fx.db.LookupDataSourceListener;

import javax.sql.DataSource;

/**
 * @author 陈实
 * @Package com.sysplat.common.dataway
 * @date 2020/12/9 18:12
 * @Description: Dataway动态数据源监听
 */
public class MyLookupDataSourceListenerImpl implements LookupDataSourceListener {

    @Override
    public DataSource lookUp(String lookupName) {
        DatawayDataSourceConfig datawayDataSourceConfig =  AppUtil.getBean(DatawayDataSourceConfig.class);
        DataSource dataSource = datawayDataSourceConfig.getDataSource(lookupName);
        return dataSource;
    }
}
