Class DinoContextThreadLocalImpl
java.lang.Object
cn.dinodev.spring.commons.context.DinoContextThreadLocalImpl
- All Implemented Interfaces:
DinoContext
#DinoContext 的ThreadLocal版本的实现- Author:
- Cody Lu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription获取当前租户voidcurrentTenant(Tenant tenant) 设置当前租户信息<K extends Serializable>
User<K>获取当前登录的用户<K extends Serializable>
voidcurrentUser(User<K> user) 设置当前用户static org.springframework.context.ApplicationContextstatic Tenantstatic <T extends User<?>>
Tstatic voidremove()static voidsetApplicationContext(org.springframework.context.ApplicationContext context) static voidsetCurrentTenant(Tenant tenant) static <T extends User<?>>
voidsetCurrentUser(T user)
-
Constructor Details
-
DinoContextThreadLocalImpl
public DinoContextThreadLocalImpl()
-
-
Method Details
-
getCurrentTenant
-
setCurrentTenant
-
remove
public static void remove() -
getCurrentUser
-
setCurrentUser
-
setApplicationContext
public static void setApplicationContext(org.springframework.context.ApplicationContext context) -
getApplicationContext
public static org.springframework.context.ApplicationContext getApplicationContext() -
currentUser
Description copied from interface:DinoContext获取当前登录的用户- Specified by:
currentUserin interfaceDinoContext- Type Parameters:
K- 用户ID类型参数- Returns:
-
currentTenant
Description copied from interface:DinoContext获取当前租户- Specified by:
currentTenantin interfaceDinoContext- Returns:
-
currentUser
Description copied from interface:DinoContext设置当前用户- Specified by:
currentUserin interfaceDinoContext
-
currentTenant
Description copied from interface:DinoContext设置当前租户信息- Specified by:
currentTenantin interfaceDinoContext
-