From b50f84f14292fa3b6709c6f1ff82c78db61e2a67 Mon Sep 17 00:00:00 2001 From: shalousun Date: Sat, 26 Jun 2021 22:05:38 +0800 Subject: [PATCH] Fix gitee #I3XO31 --- pom.xml | 2 +- .../com/power/doc/function/HtmlEscape.java | 39 +++++++++++++++++++ .../com/power/doc/model/ApiReqHeader.java | 23 +++++------ .../java/com/power/doc/utils/JsonUtil.java | 22 +++++++++++ src/main/resources/smart-doc-beetl.properties | 3 +- src/main/resources/template/AllInOne.html | 2 +- src/main/resources/template/debug-all.html | 2 +- .../template/dubbo/DubboAllInOne.html | 5 +-- src/main/resources/template/html/debug.html | 2 +- src/main/resources/template/html/dict.html | 2 +- src/main/resources/template/html/error.html | 2 +- src/main/resources/template/html/index.html | 2 +- 12 files changed, 82 insertions(+), 24 deletions(-) create mode 100644 src/main/java/com/power/doc/function/HtmlEscape.java diff --git a/pom.xml b/pom.xml index 51101fd..524c165 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ com.ibeetl beetl - 3.3.1.RELEASE + 3.3.2.RELEASE com.thoughtworks.qdox diff --git a/src/main/java/com/power/doc/function/HtmlEscape.java b/src/main/java/com/power/doc/function/HtmlEscape.java new file mode 100644 index 0000000..f557b63 --- /dev/null +++ b/src/main/java/com/power/doc/function/HtmlEscape.java @@ -0,0 +1,39 @@ +/* + * smart-doc https://github.com/shalousun/smart-doc + * + * Copyright (C) 2018-2021 smart-doc + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.power.doc.function; + +import org.beetl.core.Context; +import org.beetl.core.Function; + +/** + * @author yu 2021/6/26. + */ +public class HtmlEscape implements Function { + + @Override + public String call(Object[] paras, Context ctx) { + String str = String.valueOf(paras[0]).replaceAll("&", "&") + .replaceAll("\"","""); + return str; + } +} diff --git a/src/main/java/com/power/doc/model/ApiReqHeader.java b/src/main/java/com/power/doc/model/ApiReqHeader.java index 230f82d..5960d0c 100644 --- a/src/main/java/com/power/doc/model/ApiReqHeader.java +++ b/src/main/java/com/power/doc/model/ApiReqHeader.java @@ -67,23 +67,11 @@ public class ApiReqHeader { private String since = "-"; /** + * @since 2.2.2 * Regular expression ignore request header */ private String urlPatterns; - public String getUrlPatterns() { - return urlPatterns; - } - - public void setUrlPatterns(String urlPatterns) { - this.urlPatterns = urlPatterns; - } - - @Deprecated - public static ApiReqHeader header() { - return new ApiReqHeader(); - } - public static ApiReqHeader builder() { return new ApiReqHeader(); } @@ -142,6 +130,15 @@ public class ApiReqHeader { return this; } + public String getUrlPatterns() { + return urlPatterns; + } + + public ApiReqHeader setUrlPatterns(String urlPatterns) { + this.urlPatterns = urlPatterns; + return this; + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/src/main/java/com/power/doc/utils/JsonUtil.java b/src/main/java/com/power/doc/utils/JsonUtil.java index 6b41681..0ffe648 100644 --- a/src/main/java/com/power/doc/utils/JsonUtil.java +++ b/src/main/java/com/power/doc/utils/JsonUtil.java @@ -1,3 +1,25 @@ +/* + * smart-doc https://github.com/shalousun/smart-doc + * + * Copyright (C) 2018-2021 smart-doc + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package com.power.doc.utils; import com.google.gson.Gson; diff --git a/src/main/resources/smart-doc-beetl.properties b/src/main/resources/smart-doc-beetl.properties index 1a1b75d..d38dec4 100644 --- a/src/main/resources/smart-doc-beetl.properties +++ b/src/main/resources/smart-doc-beetl.properties @@ -1,2 +1,3 @@ DELIMITER_STATEMENT_START=<% -DELIMITER_STATEMENT_END=%> \ No newline at end of file +DELIMITER_STATEMENT_END=%> +FN.htmlEscape = com.power.doc.function.HtmlEscape \ No newline at end of file diff --git a/src/main/resources/template/AllInOne.html b/src/main/resources/template/AllInOne.html index faa86ab..f0fddb1 100644 --- a/src/main/resources/template/AllInOne.html +++ b/src/main/resources/template/AllInOne.html @@ -1,4 +1,4 @@ -<%if(isNotEmpty(projectName)){%>${projectName}<%}else{%>API Reference<%}%>
<%if(isNotEmpty(revisionLogList)){%>
<%for(revisionLog in revisionLogList){%><%}%>
VersionUpdate TimeStatusAuthorDescription

${revisionLog.version}

${revisionLog.revisionTime}

${revisionLog.status}

${revisionLog.author}

${revisionLog.remarks}

<%}%><%for(api in apiDocList){%>

${api.order}. ${api.desc}

<%for(doc in api.list){%>

<%if(doc.deprecated){%>${api.order}.${doc.order}. ${doc.desc}<%}else{%>${api.order}.${doc.order}. ${doc.desc}<%}%>

Type: ${doc.type}

<%if(isNotEmpty(doc.author)){%>

Author: ${doc.author}

<%}%>

Content-Type: ${doc.contentType}

Description: ${doc.detail}

<%if(isNotEmpty(doc.requestHeaders)){%>

Request-headers:

<%for(header in doc.requestHeaders){%><%}%>
HeaderTypeDescriptionRequiredSince

${header.name}

${header.type}

${header.desc}

${header.required}

${header.since}

<%}%><%if(isNotEmpty(doc.pathParams)){%>

Path-parameters:

<%for(param in doc.pathParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${param.desc}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.queryParams)){%>

Query-parameters:

<%for(param in doc.queryParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${param.desc}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.requestParams)){%>

Body-parameters:

<%for(param in doc.requestParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${param.desc}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%>

Request-example:

${doc.requestUsage}
<%}%><%if(isNotEmpty(doc.responseParams)){%>

Response-fields:

<%for(param in doc.responseParams){%><%}%>
FieldTypeDescriptionSince

${param.field}

${param.type}

${param.desc}

${param.version}

<%}%><%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%>

Response-example:

${doc.responseUsage}
<%}%>
<%}%>
<%}%><%if(isNotEmpty(errorCodeList)){%>

${apiDocList.~size+1}. ${errorListTitle}

<%for(error in errorCodeList){%><%}%>
Error codeDescription

${error.value}

${error.desc}

<%}%><%if(isNotEmpty(dictList)){%>

${dictListOrder}. ${dictListTitle}

<%for(dict in dictList){%>

${dictListOrder}.${dict.order}. ${dict.title}

<%for(dataDict in dict.dataDictList){%><%}%>
CodeTypeDescription

${dataDict.value}

${dataDict.type}

${dataDict.desc}

<%}%>
<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
+<%if(isNotEmpty(projectName)){%>${projectName}<%}else{%>API Reference<%}%>
<%if(isNotEmpty(revisionLogList)){%>
<%for(revisionLog in revisionLogList){%><%}%>
VersionUpdate TimeStatusAuthorDescription

${revisionLog.version}

${revisionLog.revisionTime}

${revisionLog.status}

${revisionLog.author}

${revisionLog.remarks}

<%}%><%for(api in apiDocList){%>

${api.order}. ${htmlEscape(api.desc)}

<%for(doc in api.list){%>

<%if(doc.deprecated){%>${api.order}.${doc.order}. ${doc.desc}<%}else{%>${api.order}.${doc.order}. ${htmlEscape(doc.desc)}<%}%>

Type: ${doc.type}

<%if(isNotEmpty(doc.author)){%>

Author: ${doc.author}

<%}%>

Content-Type: ${doc.contentType}

Description: ${htmlEscape(doc.detail)}

<%if(isNotEmpty(doc.requestHeaders)){%>

Request-headers:

<%for(header in doc.requestHeaders){%><%}%>
HeaderTypeDescriptionRequiredSince

${header.name}

${header.type}

${htmlEscape(header.desc)}

${header.required}

${header.since}

<%}%><%if(isNotEmpty(doc.pathParams)){%>

Path-parameters:

<%for(param in doc.pathParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.queryParams)){%>

Query-parameters:

<%for(param in doc.queryParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.requestParams)){%>

Body-parameters:

<%for(param in doc.requestParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%>

Request-example:

${doc.requestUsage}
<%}%><%if(isNotEmpty(doc.responseParams)){%>

Response-fields:

<%for(param in doc.responseParams){%><%}%>
FieldTypeDescriptionSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.version}

<%}%><%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%>

Response-example:

${doc.responseUsage}
<%}%>
<%}%>
<%}%><%if(isNotEmpty(errorCodeList)){%>

${apiDocList.~size+1}. ${errorListTitle}

<%for(error in errorCodeList){%><%}%>
Error codeDescription

${error.value}

${htmlEscape(error.desc)}

<%}%><%if(isNotEmpty(dictList)){%>

${dictListOrder}. ${dictListTitle}

<%for(dict in dictList){%>

${dictListOrder}.${dict.order}. ${htmlEscape(dict.title)}

<%for(dataDict in dict.dataDictList){%><%}%>
CodeTypeDescription

${dataDict.value}

${dataDict.type}

${htmlEscape(dataDict.desc)}

<%}%>
<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
<%if(isNotEmpty(revisionLogList)){%>
<%for(revisionLog in revisionLogList){%><%}%>
VersionUpdate TimeStatusAuthorDescription

${revisionLog.version}

${revisionLog.revisionTime}

${revisionLog.status}

${revisionLog.author}

${revisionLog.remarks}

<%}%><%for(api in apiDocList){%>

${api.order}. ${api.desc}

<%for(doc in api.list){%>

<%if(doc.deprecated){%>${api.order}.${doc.order}. ${doc.desc}<%}else{%>${api.order}.${doc.order}. ${doc.desc}<%}%>

Type: ${doc.type}

<%if(isNotEmpty(doc.author)){%>

Author: ${doc.author}

<%}%>

Content-Type: ${doc.contentType}

Description: ${doc.detail}

<%if(isNotEmpty(doc.requestHeaders)){%>

Request-headers:

<%for(header in doc.requestHeaders){%><%}%>
HeaderValueTypeRequiredDescription

${header.name}

${header.type}

${header.required}

${header.desc}

<%}%><%if(isNotEmpty(doc.pathParams)){%>

Path-parameters:

<%for(param in doc.pathParams){%><%}%>
ParameterValueTypeRequiredDescription

${param.field}

${param.type}

${param.required}

${param.desc}

<%}%><%if(isNotEmpty(doc.queryParams)){%>

Query-parameters:

<%for(param in doc.queryParams){%><%if(param.version !='-'){%><%}else{%><%}%><%}%>
ParameterValueTypeRequiredDescription

${param.field}

<%if(param.type=="file"){%><%}else{%><%}%>

${param.type}

${param.required}

${param.desc} @since ${param.version}

${param.desc}

<%}%><%if(isNotEmpty(doc.requestParams)){%>

Body-parameters:

<%for(param in doc.requestParams){%><%if(param.version !='-'){%><%}else{%><%}%><%}%>
ParameterTypeRequiredDescription

${param.field}

${param.type}

${param.required}

${param.desc} @since ${param.version}

${param.desc}

<%}%><%if(isNotEmpty(doc.requestExample.jsonBody)&&isRequestExample){%>

Request-body:

${doc.requestExample.jsonBody}
<%}%><%if(isNotEmpty(doc.responseParams)){%>

Response-fields:

<%for(param in doc.responseParams){%><%}%>
FieldTypeDescriptionSince

${param.field}

${param.type}

${param.desc}

${param.version}

<%}%>

<%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%>

Response-example:

${doc.responseUsage}
<%}%><%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%>

Curl-example:

${doc.requestUsage}
<%}%>
<%}%>
<%}%><%if(isNotEmpty(errorCodeList)){%>

${apiDocList.~size+1}. ${errorListTitle}

<%for(error in errorCodeList){%><%}%>
Error codeDescription

${error.value}

${error.desc}

<%}%><%if(isNotEmpty(dictList)){%>

${dictListOrder}. ${dictListTitle}

<%for(dict in dictList){%>

${dictListOrder}.${dict.order}. ${dict.title}

<%for(dataDict in dict.dataDictList){%><%}%>
CodeTypeDescription

${dataDict.value}

${dataDict.type}

${dataDict.desc}

<%}%>
<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
+<%if(isNotEmpty(projectName)){%>${projectName}<%}else{%>API Reference<%}%>
<%if(isNotEmpty(revisionLogList)){%>
<%for(revisionLog in revisionLogList){%><%}%>
VersionUpdate TimeStatusAuthorDescription

${revisionLog.version}

${revisionLog.revisionTime}

${revisionLog.status}

${revisionLog.author}

${revisionLog.remarks}

<%}%><%for(api in apiDocList){%>

${api.order}. ${htmlEscape(api.desc)}

<%for(doc in api.list){%>

<%if(doc.deprecated){%>${api.order}.${doc.order}. ${htmlEscape(doc.desc)}<%}else{%>${api.order}.${doc.order}. ${htmlEscape(doc.desc)}<%}%>

Type: ${doc.type}

<%if(isNotEmpty(doc.author)){%>

Author: ${doc.author}

<%}%>

Content-Type: ${doc.contentType}

Description: ${htmlEscape(doc.detail)}

<%if(isNotEmpty(doc.requestHeaders)){%>

Request-headers:

<%for(header in doc.requestHeaders){%><%}%>
HeaderValueTypeRequiredDescription

${header.name}

${header.type}

${header.required}

${htmlEscape(header.desc)}

<%}%><%if(isNotEmpty(doc.pathParams)){%>

Path-parameters:

<%for(param in doc.pathParams){%><%}%>
ParameterValueTypeRequiredDescription

${param.field}

${param.type}

${param.required}

${htmlEscape(param.desc)}

<%}%><%if(isNotEmpty(doc.queryParams)){%>

Query-parameters:

<%for(param in doc.queryParams){%><%if(param.version !='-'){%><%}else{%><%}%><%}%>
ParameterValueTypeRequiredDescription

${param.field}

<%if(param.type=="file"){%><%}else{%><%}%>

${param.type}

${param.required}

${htmlEscape(param.desc)} @since ${param.version}

${htmlEscape(param.desc)}

<%}%><%if(isNotEmpty(doc.requestParams)){%>

Body-parameters:

<%for(param in doc.requestParams){%><%if(param.version !='-'){%><%}else{%><%}%><%}%>
ParameterTypeRequiredDescription

${param.field}

${param.type}

${param.required}

${htmlEscape(param.desc)} @since ${param.version}

${htmlEscape(param.desc)}

<%}%><%if(isNotEmpty(doc.requestExample.jsonBody)&&isRequestExample){%>

Request-body:

${doc.requestExample.jsonBody}
<%}%><%if(isNotEmpty(doc.responseParams)){%>

Response-fields:

<%for(param in doc.responseParams){%><%}%>
FieldTypeDescriptionSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.version}

<%}%>

<%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%>

Response-example:

${doc.responseUsage}
<%}%><%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%>

Curl-example:

${doc.requestUsage}
<%}%>
<%}%>
<%}%><%if(isNotEmpty(errorCodeList)){%>

${apiDocList.~size+1}. ${errorListTitle}

<%for(error in errorCodeList){%><%}%>
Error codeDescription

${error.value}

${htmlEscape(error.desc)}

<%}%><%if(isNotEmpty(dictList)){%>

${dictListOrder}. ${dictListTitle}

<%for(dict in dictList){%>

${dictListOrder}.${dict.order}. ${htmlEscape(dict.title)}

<%for(dataDict in dict.dataDictList){%><%}%>
CodeTypeDescription

${dataDict.value}

${dataDict.type}

${htmlEscape(dataDict.desc)}

<%}%>
<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
diff --git a/src/main/resources/template/dubbo/DubboAllInOne.html b/src/main/resources/template/dubbo/DubboAllInOne.html index 39738e9..2fbf3f1 100644 --- a/src/main/resources/template/dubbo/DubboAllInOne.html +++ b/src/main/resources/template/dubbo/DubboAllInOne.html @@ -1,12 +1,11 @@ -<%if(isNotEmpty(projectName)){%>${projectName}<%}else{%>API Reference<%}%>
<%if(isNotEmpty(revisionLogList)){%>
<%for(revisionLog in revisionLogList){%><%}%>
VersionUpdate TimeStatusAuthorDescription

${revisionLog.version}

${revisionLog.revisionTime}

${revisionLog.status}

${revisionLog.author}

${revisionLog.remarks}

<%}%><%if(isNotEmpty(dependencyList)){%>

1. Add dependency

+<%if(isNotEmpty(projectName)){%>${projectName}<%}else{%>API Reference<%}%>
<%if(isNotEmpty(revisionLogList)){%>
<%for(revisionLog in revisionLogList){%><%}%>
VersionUpdate TimeStatusAuthorDescription

${revisionLog.version}

${revisionLog.revisionTime}

${revisionLog.status}

${revisionLog.author}

${revisionLog.remarks}

<%}%><%if(isNotEmpty(dependencyList)){%>

1. Add dependency

<%for(dp in dependencyList){%><dependency>
     <groupId>${dp.groupId}</groupId>
     <artifactId>${dp.artifactId}</artifactId>
     <version>${dp.version}</version>
 </dependency>
 <%}%>
-
-
<%if(isNotEmpty(consumerConfigExample)){%>

Consumer config

${consumerConfigExample}
<%}%>
<%}%><%for(api in apiDocList){%>

${api.order+1}. ${api.desc}

URI: ${api.uri}

Service: ${api.name}

Protocol: ${api.protocol}

Author: ${api.author}

Version: ${api.version}

<%for(doc in api.list){%>

<%if(doc.deprecated){%>${api.order+1}.${doc.order}. ${doc.desc}<%}else{%>${api.order+1}.${doc.order}. ${doc.desc}<%}%>

Definition: ${doc.escapeMethodDefinition}

Description: ${doc.detail}

<%if(isNotEmpty(doc.requestParams)){%>

Invoke-parameters:

<%for(param in doc.requestParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${param.desc}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.responseParams)){%>

Response-fields:

<%for(param in doc.responseParams){%><%}%>
FieldTypeDescriptionSince

${param.field}

${param.type}

${param.desc}

${param.version}

<%}%>
<%}%>
<%}%><%if(isNotEmpty(errorCodeList)){%>

${apiDocList.~size+2}. ${errorListTitle}

<%for(error in errorCodeList){%><%}%>
Error codeDescription

${error.value}

${error.desc}

<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
+
<%if(isNotEmpty(consumerConfigExample)){%>

Consumer config

${consumerConfigExample}
<%}%>
<%}%><%for(api in apiDocList){%>

${api.order+1}. ${htmlEscape(api.desc)}

URI: ${api.uri}

Service: ${api.name}

Protocol: ${api.protocol}

Author: ${api.author}

Version: ${api.version}

<%for(doc in api.list){%>

<%if(doc.deprecated){%>${api.order+1}.${doc.order}. ${htmlEscape(doc.desc)}<%}else{%>${api.order+1}.${doc.order}. ${htmlEscape(doc.desc)}<%}%>

Definition: ${doc.escapeMethodDefinition}

Description: ${htmlEscape(doc.detail)}

<%if(isNotEmpty(doc.requestParams)){%>

Invoke-parameters:

<%for(param in doc.requestParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.responseParams)){%>

Response-fields:

<%for(param in doc.responseParams){%><%}%>
FieldTypeDescriptionSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.version}

<%}%>
<%}%>
<%}%><%if(isNotEmpty(errorCodeList)){%>

${apiDocList.~size+2}. ${errorListTitle}

<%for(error in errorCodeList){%><%}%>
Error codeDescription

${error.value}

${htmlEscape(error.desc)}

<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github

${order}. ${desc}

<%for(doc in list){%>

<%if(doc.deprecated){%>${order}.${doc.order}. ${doc.desc}<%}else{%>${order}.${doc.order}. ${doc.desc}<%}%>

Type: ${doc.type}

<%if(isNotEmpty(doc.author)){%>

Author: ${doc.author}

<%}%>

Content-Type: ${doc.contentType}

Description: ${doc.detail}

<%if(isNotEmpty(doc.requestHeaders)){%>

Request-headers:

<%for(header in doc.requestHeaders){%><%}%>
HeaderValueTypeRequiredDescription

${header.name}

${header.type}

${header.required}

${header.desc}

<%}%><%if(isNotEmpty(doc.pathParams)){%>

Path-parameters:

<%for(param in doc.pathParams){%><%}%>
ParameterValueTypeRequiredDescription

${param.field}

${param.type}

${param.required}

${param.desc}

<%}%><%if(isNotEmpty(doc.queryParams)){%>

Query-parameters:

<%for(param in doc.queryParams){%><%if(param.version !='-'){%><%}else{%><%}%><%}%>
ParameterValueTypeRequiredDescription

${param.field}

<%if(param.type=="file"){%><%}else{%><%}%>

${param.type}

${param.required}

${param.desc} @since ${param.version}

${param.desc}

<%}%><%if(isNotEmpty(doc.requestParams)){%>

Body-parameters:

<%for(param in doc.requestParams){%><%if(param.version !='-'){%><%}else{%><%}%><%}%>
ParameterTypeRequiredDescription

${param.field}

${param.type}

${param.required}

${param.desc} @since ${param.version}

${param.desc}

<%}%><%if(isNotEmpty(doc.requestExample.jsonBody)&&isRequestExample){%>

Request-body:

${doc.requestExample.jsonBody}
<%}%><%if(isNotEmpty(doc.responseParams)){%>

Response-fields:

<%for(param in doc.responseParams){%><%}%>
FieldTypeDescriptionSince

${param.field}

${param.type}

${param.desc}

${param.version}

<%}%>

<%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%>

Response-example:

${doc.responseUsage}
<%}%><%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%>

Curl-example:

${doc.requestUsage}
<%}%>
<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
+<%if(isNotEmpty(projectName)){%>${projectName}<%}else{%>API Reference<%}%>

${order}. ${desc}

<%for(doc in list){%>

<%if(doc.deprecated){%>${order}.${doc.order}. ${doc.desc}<%}else{%>${order}.${doc.order}. ${htmlEscape(doc.desc)}<%}%>

Type: ${doc.type}

<%if(isNotEmpty(doc.author)){%>

Author: ${doc.author}

<%}%>

Content-Type: ${doc.contentType}

Description: ${htmlEscape(doc.detail)}

<%if(isNotEmpty(doc.requestHeaders)){%>

Request-headers:

<%for(header in doc.requestHeaders){%><%}%>
HeaderValueTypeRequiredDescription

${header.name}

${header.type}

${header.required}

${htmlEscape(header.desc)}

<%}%><%if(isNotEmpty(doc.pathParams)){%>

Path-parameters:

<%for(param in doc.pathParams){%><%}%>
ParameterValueTypeRequiredDescription

${param.field}

${param.type}

${param.required}

${htmlEscape(param.desc)}

<%}%><%if(isNotEmpty(doc.queryParams)){%>

Query-parameters:

<%for(param in doc.queryParams){%><%if(param.version !='-'){%><%}else{%><%}%><%}%>
ParameterValueTypeRequiredDescription

${param.field}

<%if(param.type=="file"){%><%}else{%><%}%>

${param.type}

${param.required}

${htmlEscape(param.desc)} @since ${param.version}

${htmlEscape(param.desc)}

<%}%><%if(isNotEmpty(doc.requestParams)){%>

Body-parameters:

<%for(param in doc.requestParams){%><%if(param.version !='-'){%><%}else{%><%}%><%}%>
ParameterTypeRequiredDescription

${param.field}

${param.type}

${param.required}

${htmlEscape(param.desc)} @since ${param.version}

${htmlEscape(param.desc)}

<%}%><%if(isNotEmpty(doc.requestExample.jsonBody)&&isRequestExample){%>

Request-body:

${doc.requestExample.jsonBody}
<%}%><%if(isNotEmpty(doc.responseParams)){%>

Response-fields:

<%for(param in doc.responseParams){%><%}%>
FieldTypeDescriptionSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.version}

<%}%>

<%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%>

Response-example:

${doc.responseUsage}
<%}%><%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%>

Curl-example:

${doc.requestUsage}
<%}%>
<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
diff --git a/src/main/resources/template/html/dict.html b/src/main/resources/template/html/dict.html index 03974f6..c0a83cd 100644 --- a/src/main/resources/template/html/dict.html +++ b/src/main/resources/template/html/dict.html @@ -1,4 +1,4 @@ -SpringBoot2-Open-Api
<%if(isNotEmpty(dictList)){%>

${dictListOrder}. ${dictListTitle}

<%for(dict in dictList){%>

${dictListOrder}.${dict.order}. ${dict.title}

<%for(dataDict in dict.dataDictList){%><%}%>
CodeTypeDescription

${dataDict.value}

${dataDict.type}

${dataDict.desc}

<%}%>
<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
+Dictionary
<%if(isNotEmpty(dictList)){%>

${dictListOrder}. ${dictListTitle}

<%for(dict in dictList){%>

${dictListOrder}.${dict.order}. ${dict.title}

<%for(dataDict in dict.dataDictList){%><%}%>
CodeTypeDescription

${dataDict.value}

${dataDict.type}

${htmlEscape(dataDict.desc)}

<%}%>
<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
<%if(isNotEmpty(errorCodeList)){%>

${apiDocList.~size+1}. ${errorListTitle}

${apiDocList.~size+1}.1. ${errorListTitle}

<%for(error in errorCodeList){%><%}%>
Error codeDescription

${error.value}

${error.desc}

<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
+Error Code
<%if(isNotEmpty(errorCodeList)){%>

${apiDocList.~size+1}. ${errorListTitle}

${apiDocList.~size+1}.1. ${errorListTitle}

<%for(error in errorCodeList){%><%}%>
Error codeDescription

${error.value}

${htmlEscape(error.desc)}

<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github

${order}. ${desc}

<%for(doc in list){%>

<%if(doc.deprecated){%>${order}.${doc.order}. ${doc.desc}<%}else{%>${order}.${doc.order}. ${doc.desc}<%}%>

Type: ${doc.type}

<%if(isNotEmpty(doc.author)){%>

Author: ${doc.author}

<%}%>

Content-Type: ${doc.contentType}

Description: ${doc.detail}

<%if(isNotEmpty(doc.requestHeaders)){%>

Request-headers:

<%for(header in doc.requestHeaders){%><%}%>
HeaderTypeDescriptionRequiredSince

${header.name}

${header.type}

${header.desc}

${header.required}

${header.since}

<%}%><%if(isNotEmpty(doc.pathParams)){%>

Path-parameters:

<%for(param in doc.pathParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${param.desc}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.queryParams)){%>

Query-parameters:

<%for(param in doc.queryParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${param.desc}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.requestParams)){%>

Body-parameters:

<%for(param in doc.requestParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${param.desc}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%>

Request-example:

${doc.requestUsage}
<%}%><%if(isNotEmpty(doc.responseParams)){%>

Response-fields:

<%for(param in doc.responseParams){%><%}%>
FieldTypeDescriptionSince

${param.field}

${param.type}

${param.desc}

${param.version}

<%}%><%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%>

Response-example:

${doc.responseUsage}
<%}%>
<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
+<%if(isNotEmpty(projectName)){%>${projectName}<%}else{%>API Reference<%}%>

${order}. ${htmlEscape(desc)}

<%for(doc in list){%>

<%if(doc.deprecated){%>${order}.${doc.order}. ${htmlEscape(doc.desc)}<%}else{%>${order}.${doc.order}. ${htmlEscape(doc.desc)}<%}%>

Type: ${doc.type}

<%if(isNotEmpty(doc.author)){%>

Author: ${doc.author}

<%}%>

Content-Type: ${doc.contentType}

Description: ${htmlEscape(doc.detail)}

<%if(isNotEmpty(doc.requestHeaders)){%>

Request-headers:

<%for(header in doc.requestHeaders){%><%}%>
HeaderTypeDescriptionRequiredSince

${header.name}

${header.type}

${htmlEscape(header.desc)}

${header.required}

${header.since}

<%}%><%if(isNotEmpty(doc.pathParams)){%>

Path-parameters:

<%for(param in doc.pathParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.queryParams)){%>

Query-parameters:

<%for(param in doc.queryParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.requestParams)){%>

Body-parameters:

<%for(param in doc.requestParams){%><%}%>
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.required}

${param.version}

<%}%><%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%>

Request-example:

${doc.requestUsage}
<%}%><%if(isNotEmpty(doc.responseParams)){%>

Response-fields:

<%for(param in doc.responseParams){%><%}%>
FieldTypeDescriptionSince

${param.field}

${param.type}

${htmlEscape(param.desc)}

${param.version}

<%}%><%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%>

Response-example:

${doc.responseUsage}
<%}%>
<%}%>
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github