package com.crm.rely.backend.util;

/**
 * @Author houn
 * @Date 2024/12/24 13:59
 * @PackageName:com.crm.manager.configuration
 * @ClassName: DynamicDataSourceContext
 * @Description: TODO
 */
public class DynamicDataSourceContext {
    private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();

    public static String getDataSource() {
        return CONTEXT_HOLDER.get();
    }

    public static void setDataSource(String dataSource) {
        CONTEXT_HOLDER.set(dataSource);
    }

    public static void clear() {
        CONTEXT_HOLDER.remove();
    }
}