package com.crm.rely.backend.util;

import java.util.Map;

/**
 * @program: user-custom
 * @description: 模版工具
 * @author: houn
 * @create: 2019-06-19 19:28
 */
public class TemplateUtil {

    /**
     * 替换内容
     *
     * @param content
     * @param map
     * @return
     */
    public static String replace(String content, Map<String, String> map) {
        if (map != null) {
            for (Map.Entry<String, String> entry : map.entrySet()) {
                if (entry.getKey() != null && entry.getValue() != null) {
                    content = content.replace(entry.getKey(), entry.getValue());
                }
            }
        }

        return content;
    }

}
