package com.sdut.labex.utils;

import com.sdut.labex.entity.User;

/**
 * File: UserHolder
 * Created: 2023/6/11
 * Author: springforest
 * Description:
 */

public class UserHolder {
    private static final ThreadLocal<User> tl = new ThreadLocal<>();

    public static void saveUser(User user) {
        tl.set(user);
    }

    public static User getUser() {
        return tl.get();
    }

    public static void removeUser() {
        tl.remove();
    }
}
