package com.jkcredit.identity.util;

import com.jkcredit.identity.constant.CommonConstants;
import com.jkcredit.identity.model.vo.TokenVo;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @author xusonglin
 * @version V1.0
 **/
public enum TokenConCurrentHashMapUtil {
    // 实例
    INSTANCE;

    private static ConcurrentHashMap<String, TokenVo> concurrentHashMap = new ConcurrentHashMap<>();

    public static ConcurrentHashMap<String, TokenVo> getInstance () {
        return concurrentHashMap;
    }

    public static void updateToken(TokenVo tokenVo) {
        concurrentHashMap.put(CommonConstants.TOKEN_KEY, tokenVo);
    }

}
