add project name in html template

This commit is contained in:
oppofind 2019-11-22 21:56:53 +08:00
parent d5e770a78f
commit 6af0cd6984
6 changed files with 42 additions and 7 deletions

View File

@ -133,6 +133,6 @@
1. 修改Spring Controller使用非Spring Web注解时生成的响应示例出错的bug。 1. 修改Spring Controller使用非Spring Web注解时生成的响应示例出错的bug。
2. 修改使用mybatis-plus实体继承Model对象时将log字段输出到文档的问题。 2. 修改使用mybatis-plus实体继承Model对象时将log字段输出到文档的问题。
3. 添加对transient修饰字段文档输出开关默认不输出。 3. 添加对transient修饰字段文档输出开关默认不输出。
4. html文档添加项目名称显示

View File

@ -0,0 +1,8 @@
package com.power.doc.builder;
/**
* @author yu 2019/11/21.
*/
public class PostMainJsonBuilder {
}

View File

@ -7,6 +7,7 @@ import com.power.common.util.UrlUtil;
import com.power.doc.constants.DocAnnotationConstants; import com.power.doc.constants.DocAnnotationConstants;
import com.power.doc.constants.DocGlobalConstants; import com.power.doc.constants.DocGlobalConstants;
import com.power.doc.constants.DocTags; import com.power.doc.constants.DocTags;
import com.power.doc.constants.Methods;
import com.power.doc.model.*; import com.power.doc.model.*;
import com.power.doc.utils.DocClassUtil; import com.power.doc.utils.DocClassUtil;
import com.power.doc.utils.DocUtil; import com.power.doc.utils.DocUtil;
@ -200,25 +201,25 @@ public class SourceBuilder {
isPostMethod = true; isPostMethod = true;
} }
} else { } else {
methodType = "GET"; methodType = Methods.GET.getValue();
} }
methodCounter++; methodCounter++;
} else if (GET_MAPPING.equals(annotationName) || DocGlobalConstants.GET_MAPPING_FULLY.equals(annotationName)) { } else if (GET_MAPPING.equals(annotationName) || DocGlobalConstants.GET_MAPPING_FULLY.equals(annotationName)) {
url = DocUtil.handleMappingValue(annotation); url = DocUtil.handleMappingValue(annotation);
methodType = "GET"; methodType = Methods.GET.getValue();
methodCounter++; methodCounter++;
} else if (POST_MAPPING.equals(annotationName) || DocGlobalConstants.POST_MAPPING_FULLY.equals(annotationName)) { } else if (POST_MAPPING.equals(annotationName) || DocGlobalConstants.POST_MAPPING_FULLY.equals(annotationName)) {
url = DocUtil.handleMappingValue(annotation); url = DocUtil.handleMappingValue(annotation);
methodType = "POST"; methodType = Methods.POST.getValue();
methodCounter++; methodCounter++;
isPostMethod = true; isPostMethod = true;
} else if (PUT_MAPPING.equals(annotationName) || DocGlobalConstants.PUT_MAPPING_FULLY.equals(annotationName)) { } else if (PUT_MAPPING.equals(annotationName) || DocGlobalConstants.PUT_MAPPING_FULLY.equals(annotationName)) {
url = DocUtil.handleMappingValue(annotation); url = DocUtil.handleMappingValue(annotation);
methodType = "PUT"; methodType = Methods.PUT.getValue();
methodCounter++; methodCounter++;
} else if (DELETE_MAPPING.equals(annotationName) || DocGlobalConstants.DELETE_MAPPING_FULLY.equals(annotationName)) { } else if (DELETE_MAPPING.equals(annotationName) || DocGlobalConstants.DELETE_MAPPING_FULLY.equals(annotationName)) {
url = DocUtil.handleMappingValue(annotation); url = DocUtil.handleMappingValue(annotation);
methodType = "DELETE"; methodType = Methods.DELETE.getValue();
methodCounter++; methodCounter++;
} }
} }

View File

@ -0,0 +1,23 @@
package com.power.doc.constants;
/**
* http methods
* @author yu 2019/11/21.
*/
public enum Methods {
POST("POST"),
GET("GET"),
PUT("PUT"),
DELETE("DELETE"),
OPTIONS("OPTIONS");
private String value;
Methods(String value){
this.value = value;
}
public String getValue() {
return value;
}
}

View File

@ -1,3 +1,6 @@
<%if(isNotEmpty(projectName)){%>
= ${projectName}
<%}%>
<%if(isNotEmpty(revisionLogList)){%> <%if(isNotEmpty(revisionLogList)){%>
[width="100%",options="header"] [width="100%",options="header"]

File diff suppressed because one or more lines are too long