package cc.iotkit.data.config;
import javax.servlet.*;
import java.io.IOException;

public class TenantAspectFilter implements Filter{
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        // 初始化逻辑（可选）
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response,
                         FilterChain chain) throws IOException, ServletException {
        try {
           // TenantContext.disableTenantFilter();
            chain.doFilter(request, response);
        } finally {
            TenantContext.enableTenantFilter();
        }
    }

    @Override
    public void destroy() {
        // 清理资源（可选）
    }
}
