提交 ac3290fa authored 作者: 刘海泉's avatar 刘海泉

修改替换字符串的方法

上级 d9420a95
...@@ -209,8 +209,12 @@ public class SendInternalMessageServiceImpl implements SendInternalMessageServic ...@@ -209,8 +209,12 @@ public class SendInternalMessageServiceImpl implements SendInternalMessageServic
//构建站内信中的内容,替换变量 //构建站内信中的内容,替换变量
private String replaceContent(String content,List<String> list){ private String replaceContent(String content,List<String> list){
int listSize = 0;
int times = countCharTimes(content, "%s"); int times = countCharTimes(content, "%s");
if(times != list.size()){ if(CollectionUtils.isNotEmpty(list)){
listSize = list.size();
}
if(times != listSize){
log.error("替换的变量和字符串中需要的变量数量不一致"); log.error("替换的变量和字符串中需要的变量数量不一致");
return null; return null;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论