package com.ssm.manage.entity;

import com.alibaba.ttl.TransmittableThreadLocal;
import com.ssm.manage.response.StaffResponse;
import lombok.Data;
import org.springframework.stereotype.Component;

public class StaticBaseStaff {
    private static final ThreadLocal<StaffResponse> BASE_STAFF_THREAD_LOCAL=new TransmittableThreadLocal<>();

    public static void setBaseStaff(StaffResponse baseStaff){BASE_STAFF_THREAD_LOCAL.set(baseStaff);}

    public static StaffResponse getBaseStaff(){
        return  BASE_STAFF_THREAD_LOCAL.get();
    }

    public static void clean(){BASE_STAFF_THREAD_LOCAL.remove();}
}
