package com.ruoyi.web.modules.account.support;

/**
 * 当前 C 端会员上下文
 */
public final class MemberContext
{
    private static final ThreadLocal<Long> MEMBER_ID = new ThreadLocal<>();

    private MemberContext()
    {
    }

    public static void setMemberId(Long memberId)
    {
        MEMBER_ID.set(memberId);
    }

    public static Long getMemberId()
    {
        return MEMBER_ID.get();
    }

    public static void clear()
    {
        MEMBER_ID.remove();
    }
}
