public void init(String templateBaseLocation){
        // 初始化FreeMarker配置
        // 创建一个Configuration实例
        cfg = new Configuration();
        cfg.setDefaultEncoding(Config.getEncoding());
        log.debug("encoding:" + Config.getEncoding());
        log.debug("locale:"+Config.getLocale());
        cfg.setEncoding(Locale.forLanguageTag(Config.getLocale()),Config.getEncoding());
        cfg.setOutputEncoding(Config.getEncoding());

        // 设置FreeMarker的模版文件位置
        File baseLocation = new File(templateBaseLocation);
        if(!baseLocation.exists()){
            throw new TemplateException(String.format("Template group was found in directory %s",baseLocation.getAbsolutePath()));
        }
        log.info("template base location : "+ templateBaseLocation);
        try {
            cfg.setDirectoryForTemplateLoading(baseLocation);
        } catch (IOException e) {
            log.error(e);
        }
    }