订单
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.starry.admin.common.conf;
|
||||
|
||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
|
||||
/**
|
||||
@@ -9,35 +9,35 @@ import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
* @since : 2024/4/2 12:10 AM
|
||||
*/
|
||||
public class ThreadLocalRequestDetail {
|
||||
private static final TransmittableThreadLocal<Object> threadLocal = new TransmittableThreadLocal<>();
|
||||
private static final TransmittableThreadLocal<Object> THREAD_LOCAL = new TransmittableThreadLocal<>();
|
||||
|
||||
/**
|
||||
* 设置请求信息到当前线程中
|
||||
*/
|
||||
public static void setRequestDetail(Object data) {
|
||||
threadLocal.set(data);
|
||||
THREAD_LOCAL.set(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从当前线程中获取请求信息
|
||||
*/
|
||||
public static Object getRequestDetail() {
|
||||
return threadLocal.get();
|
||||
return THREAD_LOCAL.get();
|
||||
}
|
||||
|
||||
public static PlayClerkUserInfoEntity getClerkUserInfo() {
|
||||
return (PlayClerkUserInfoEntity) threadLocal.get();
|
||||
return (PlayClerkUserInfoEntity) THREAD_LOCAL.get();
|
||||
}
|
||||
|
||||
public static PlayCustomUserInfoEntity getCustomUserInfo() {
|
||||
return (PlayCustomUserInfoEntity) threadLocal.get();
|
||||
return (PlayCustomUserInfoEntity) THREAD_LOCAL.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* 销毁
|
||||
*/
|
||||
public static void remove() {
|
||||
threadLocal.remove();
|
||||
THREAD_LOCAL.remove();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user