1.引入依赖
compile('cn.hutool:hutool-all:5.3.5')
2.读取html模板内容转化为String
/**
* 获取注册协议
*
* @param
* @return java.lang.String
* @author shy
* @date 2021/1/11 16:18
*/
public String getRegisterAgreement() {
try {
File file = ResourceUtils.getFile("classpath:template/register-agreement.html");
return FileReader.create(file).readString();
} catch (FileNotFoundException e) {
log.error("", e);
}
return Constant.STRING_NULL;
}