package cn.fateverse.query.utils;

import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

/**
 * @author Clay
 * @date 2023-07-16
 */
public class MyBatisResourceUtils {

    public static Resource[] getResources(String location) {
        PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver = new PathMatchingResourcePatternResolver();
        Resource resource = pathMatchingResourcePatternResolver.getResource(location);
        Resource baseResource = pathMatchingResourcePatternResolver.getResource("classpath:mapper/dynamic/DynamicDataSourceMapper.xml");
        Resource[] resources = new Resource[2];
        resources[0] = resource;
        resources[1] = baseResource;
        return resources;
    }
}
