package cn.quantgroup.customer.config.container;

import cn.quantgroup.customer.entity.OpUser;

/**
 * @author yangjun
 * @Date 2020/4/16 10:46
 * @Desc
 * @Update
 */
public class UserThreadLocal {
    private static ThreadLocal<OpUser> userThread =
            new ThreadLocal<OpUser>();

    public static void set(OpUser user){
        userThread.set(user);
    }

    public static OpUser get(){
        return userThread.get();
    }

    //防止内存泄漏
    public static void remove(){
        userThread.remove();
    }
}
