update 'error code title ' set error when set language is chinese

This commit is contained in:
oppofind 2019-10-29 11:09:00 +08:00
parent 5ed1c6f39d
commit 8874c4a80e
4 changed files with 14 additions and 5 deletions

View File

@ -103,6 +103,15 @@ public class DocBuilderTemplate {
tpl.binding(TemplateVariable.VERSION_LIST.getVariable(), config.getRevisionLogs());
tpl.binding(TemplateVariable.VERSION.getVariable(),now);
tpl.binding(TemplateVariable.CREATE_TIME.getVariable(), strTime);
if (null != config.getLanguage()) {
if (DocLanguage.CHINESE.code.equals(config.getLanguage().getCode())) {
tpl.binding(TemplateVariable.ERROR_LIST_TITLE.getVariable(), DocGlobalConstants.ERROR_CODE_LIST_CN_TITLE);
} else {
tpl.binding(TemplateVariable.ERROR_LIST_TITLE.getVariable(), DocGlobalConstants.ERROR_CODE_LIST_EN_TITLE);
}
} else {
tpl.binding(TemplateVariable.ERROR_LIST_TITLE.getVariable(), DocGlobalConstants.ERROR_CODE_LIST_CN_TITLE);
}
FileUtil.nioWriteFile(tpl.render(), outPath + FILE_SEPARATOR + outPutFileName);
}

View File

@ -86,7 +86,7 @@ ${doc.responseUsage}
<% } %>
<% } %>
<%if(isNotEmpty(errorCodeList)){%>
== Error code list
== ${errorListTitle}
[width="100%",options="header"]
[stripes=even]

View File

@ -13,11 +13,11 @@ ${revisionLog.version}|${revisionLog.revisionTime}|${revisionLog.status}|${revis
<%
for(api in apiDocList){
%>
# ${api.desc}
# ${api.order}. ${api.desc}
<%
for(doc in api.list){
%>
## ${doc.desc}
## ${api.order}.${doc.order} ${doc.desc}
**URL:** ${doc.url}
**Type:** ${doc.type}
@ -74,7 +74,7 @@ ${doc.responseUsage}
<% } %>
<% } %>
<%if(isNotEmpty(errorCodeList)){%>
# Error code list
# ${apiDocList.~size+1}. ${errorListTitle}
Error code |Description
---|---
<%

File diff suppressed because one or more lines are too long