package com.kexue.skills.interceptor;

/**
 * @author 维哥
 * @Description
 * @create 2025-02-28 23:07
 */
public class UserContextHolder {
    private static final ThreadLocal<String> USER_HOLDER = new ThreadLocal<>();

    public static void setUserName(String username) {
        USER_HOLDER.set(username);
    }

    public static String getUserName() {
        return USER_HOLDER.get();
    }

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