package com.younike.framework.web.domain;

/**
 * 客户
 *
 * @author chenpengfei
 */
public class MemberUserContext implements AutoCloseable {

    static final ThreadLocal<Long> ctx = new ThreadLocal<>();

    public MemberUserContext(Long user) {
        ctx.set(user);
    }

    public static Long currentUser() {
        return ctx.get();
    }

    @Override
    public void close() {
        ctx.remove();
    }
}