com.youta8.frame.common.context.UserContext Maven / Gradle / Ivy
package com.youta8.frame.common.context;
import com.youta8.frame.common.entity.LoginUser;
/**
* 用户上下文
*
* @author youta
*/
public class UserContext {
private static ThreadLocal userHolder = new ThreadLocal<>();
public static void setUser(LoginUser loginUser) {
userHolder.set(loginUser);
}
public static LoginUser getUser() {
return userHolder.get();
}
}