package com.example.demo.common;

import pers.jc.util.JCCacheMap;
import pers.jc.util.JCFileTool;

public class CacheMapRoot {
    public static JCCacheMap roomNeedCalculatePKScore = new JCCacheMap();
    public static JCCacheMap validateEmail = new JCCacheMap();
    public static JCCacheMap validatePhone = new JCCacheMap();

    public static String GetDirPath() {
        return JCFileTool.joinPath(JCFileTool.getRootPath(), "CacheMapRoot");
    }

    public static void init() {
        roomNeedCalculatePKScore.loadFrom(GetDirPath(), "roomNeedCalculatePKScore");
        validateEmail.loadFrom(GetDirPath(), "validateEmail");
        validatePhone.loadFrom(GetDirPath(), "validatePhone");
    }

    public static void save() {
        roomNeedCalculatePKScore.saveTo(GetDirPath(), "roomNeedCalculatePKScore");
        validateEmail.saveTo(GetDirPath(), "validateEmail");
        validatePhone.saveTo(GetDirPath(), "validatePhone");
    }
}
