This commit is contained in:
admin
2024-05-08 21:21:29 +08:00
parent 2919029b81
commit 5838b2df35
138 changed files with 2861 additions and 1179 deletions

View File

@@ -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();
}
}