package com.dataeasy.server.utiis; /** * @author tyuio * @version 1.0.0 * @date 2024/11/25 10:15 * @description 用户信息相关工具类 */ public class UserUtils { public static final ThreadLocal threadLocal = new ThreadLocal<>(); /** * 设置当前用户的ID * @param id */ public static void setCurrentId(Long id) { threadLocal.set(id); } /** * 获取当前用户的ID * @return */ public static Long getCurrentUserId() { return threadLocal.get(); } }