package com.huigou.topsun.base.dictionary;

import com.huigou.util.StringUtil;

import java.util.concurrent.atomic.AtomicReference;

public class GlobalCode {

    private static AtomicReference<String> str = new AtomicReference<>("");

    public static void set(String newValue) {
        str.set(newValue);
    }

    public static String get() {
        if(StringUtil.isBlank( str.get())){
            throw new RuntimeException("未选择编码");
        }
        return str.get();
    }
}
