package com.ai.da.common.context;

import com.ai.da.model.vo.AuthPrincipalVo;

public class UserContext {
    private static ThreadLocal<AuthPrincipalVo> userHolder = new ThreadLocal<AuthPrincipalVo>();

    public static AuthPrincipalVo getUserHolder() {
        return userHolder.get();
    }

    public static void delete() {
        userHolder.remove();
    }

    public static void setUserHolder(AuthPrincipalVo authPrincipalVo) {
        userHolder.set(authPrincipalVo);
    }
}
