package cn.mb.cloud.gateway.handler;
|
|
import com.alibaba.ttl.TransmittableThreadLocal;
|
|
public class AppTypeContextHolder {
|
|
private final static ThreadLocal<String> DEVEICE_LOCAL = new TransmittableThreadLocal<>();
|
|
public final static String APP_TYPE="AppType";
|
|
/**
|
* 上下文中获取当
|
* @param tenantId
|
*/
|
public static void setDeviceType(String tenantId) {
|
DEVEICE_LOCAL.set(tenantId);
|
}
|
|
|
public static String getDeviceType() {
|
return DEVEICE_LOCAL.get();
|
}
|
|
public static void clear() {
|
DEVEICE_LOCAL.remove();
|
}
|
}
|