把文书模板语法配置、自定义列表标签配置、自定义字符串列表元素拼接分割符提取成docker镜像的环境变量
This commit is contained in:
@@ -9,6 +9,7 @@ import java.util.Map;
|
||||
* @since 2022/12/28
|
||||
*/
|
||||
public interface DocumentService {
|
||||
|
||||
/**
|
||||
* 格式转换
|
||||
*
|
||||
@@ -79,4 +80,24 @@ public interface DocumentService {
|
||||
default byte[] xlsToXlsx(byte[] source) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板语法配置
|
||||
* <ul>
|
||||
* <li>
|
||||
* 模板语法参考:<a href="https://deepoove.com/poi-tl/">POI-TL语法</a>
|
||||
* </li>
|
||||
* <li>
|
||||
* 这里的配置会将原来的 {{ 替换为{@link Gramer#getPrefix()}, }} 替换为{@link Gramer#getSuffix()}
|
||||
* </li>
|
||||
* <li>
|
||||
* 增加以{@link Gramer#getCustomizeListTag()}开头的列表对象处理插件,其字符串类型列表分隔符为{@link Gramer#getCustomizeListTagStringDelimiting()}
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* @return 模板语法配置
|
||||
*/
|
||||
default Gramer gramer() {
|
||||
return new Gramer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.optima.document.api;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 文书模板中的语法标签
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class Gramer {
|
||||
/// 模板语法开始字符串
|
||||
private String prefix = "${";
|
||||
/// 模板语法结束字符串
|
||||
private String suffix = "}";
|
||||
/// 自定义列表对象标签
|
||||
private Character customizeList = '%';
|
||||
/// 自定义列表对象标签处理字符串列表时的分隔符
|
||||
private String customizeListStringDelimiting = ",";
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"properties": [
|
||||
{
|
||||
"name": "document.gramer.prefix",
|
||||
"type": "java.lang.String",
|
||||
"description": "模板语法开始字符串. 默认为 '${'.",
|
||||
"defaultValue": "${",
|
||||
"sourceType": "com.optima.document.api.Gramer"
|
||||
},
|
||||
{
|
||||
"name": "document.gramer.suffix",
|
||||
"type": "java.lang.String",
|
||||
"description": "模板语法结束字符串. 默认为 '}'.",
|
||||
"defaultValue": "}",
|
||||
"sourceType": "com.optima.document.api.Gramer"
|
||||
},
|
||||
{
|
||||
"name": "document.gramer.customize-list",
|
||||
"type": "java.lang.Character",
|
||||
"description": "自定义列表对象标签. 默认为 '%'. 只能为单个字符.",
|
||||
"defaultValue": "%",
|
||||
"sourceType": "com.optima.document.api.Gramer"
|
||||
},
|
||||
{
|
||||
"name": "document.gramer.customize-list-string-delimiting",
|
||||
"type": "java.lang.String",
|
||||
"description": "自定义列表对象标签处理字符串列表时的分隔符. 默认为 '、'.",
|
||||
"defaultValue": "、",
|
||||
"sourceType": "com.optima.document.api.Gramer"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user