Добавление реплик и балансировщик миграции отдельно
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package org.example.config;
|
||||
|
||||
import org.example.model.User;
|
||||
|
||||
public class UserContext {
|
||||
private static final ThreadLocal<User> CURRENT_USER = new ThreadLocal<>();
|
||||
|
||||
public static void setCurrentUser(User user) {
|
||||
CURRENT_USER.set(user);
|
||||
}
|
||||
|
||||
public static User getCurrentUser() {
|
||||
return CURRENT_USER.get();
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
CURRENT_USER.remove();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user