Commit 515cce39 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 71a329a1 bc132aba
......@@ -20,9 +20,7 @@ import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.*;
@Slf4j
public class WordTemplateUtils {
......@@ -239,6 +237,8 @@ public class WordTemplateUtils {
escapedMap.put(key, escapeValue((String) value));
} else if (value instanceof Map) {
escapedMap.put(key, escapeSpecialCharacters((Map<String, Object>) value));
} else if (value instanceof List) {
escapedMap.put(key, escapeList((List<?>) value));
} else {
escapedMap.put(key, value);
}
......@@ -246,6 +246,22 @@ public class WordTemplateUtils {
return escapedMap;
}
private static List<Object> escapeList(List<?> inputList) {
List<Object> escapedList = new ArrayList<>();
for (Object value : inputList) {
if (value instanceof String) {
escapedList.add(escapeValue((String) value));
} else if (value instanceof Map) {
escapedList.add(escapeSpecialCharacters((Map<String, Object>) value));
} else if (value instanceof List) {
escapedList.add(escapeList((List<?>) value));
} else {
escapedList.add(value);
}
}
return escapedList;
}
private static String escapeValue(String value) {
if (value == null) {
return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment