update reversion log

This commit is contained in:
oppofind 2021-03-19 16:01:09 +08:00
parent 6f4b72e3d6
commit fd44d83c9c
2 changed files with 20 additions and 0 deletions

View File

@ -23,6 +23,7 @@
package com.power.doc.builder;
import com.power.common.util.CollectionUtil;
import com.power.common.util.DateTimeUtil;
import com.power.common.util.EnumUtil;
import com.power.common.util.StringUtil;
import com.power.doc.constants.DocGlobalConstants;
@ -31,6 +32,7 @@ import com.power.doc.constants.TemplateVariable;
import com.power.doc.model.ApiConfig;
import com.power.doc.model.ApiErrorCode;
import com.power.doc.model.ApiErrorCodeDictionary;
import com.power.doc.model.RevisionLog;
import org.beetl.core.Template;
import java.util.*;
@ -40,6 +42,8 @@ import java.util.*;
*/
public class BaseDocBuilderTemplate {
public static long NOW = System.currentTimeMillis();
/**
* check condition and init
*
@ -68,6 +72,17 @@ public class BaseDocBuilderTemplate {
config.setLanguage(DocLanguage.CHINESE);
System.setProperty(DocGlobalConstants.DOC_LANGUAGE, DocLanguage.CHINESE.getCode());
}
if (Objects.isNull(config.getRevisionLogs())) {
String strTime = DateTimeUtil.long2Str(NOW, DateTimeUtil.DATE_FORMAT_SECOND);
config.setRevisionLogs(
RevisionLog.builder()
.setRevisionTime(strTime)
.setAuthor("@" + System.getProperty("user.name"))
.setVersion("v" + strTime)
.setRemarks("Created by smart-doc")
.setStatus("auto")
);
}
}
public Map<String, String> setDirectoryLanguageVariable(ApiConfig config, Template mapper) {

View File

@ -102,6 +102,11 @@ public interface DocTags {
*/
String PAGE = "page";
/**
* custom @ignoreParams tag
*/
String IGNORE_PARAMS = "ignoreParams";
/**
* Ignore ResponseBodyAdvice