提交 | 用户 | 时间 | ||
1ac2bc | 1 | package cn.stylefeng.guns.base.tenant.context; |
懒 | 2 | |
3 | /** | |
4 | * 租户编码的临时存放 | |
5 | * | |
6 | * @author fengshuonan | |
7 | * @date 2019-06-19-14:08 | |
8 | */ | |
9 | public class TenantCodeHolder { | |
10 | ||
11 | private static ThreadLocal<String> threadLocal = new ThreadLocal<>(); | |
12 | ||
13 | public static void put(String value) { | |
14 | threadLocal.set(value); | |
15 | } | |
16 | ||
17 | public static String get() { | |
18 | return threadLocal.get(); | |
19 | } | |
20 | ||
21 | public static void remove() { | |
22 | threadLocal.remove(); | |
23 | } | |
24 | } |