diff --git a/apidoc-core/build.gradle b/apidoc-core/build.gradle index 2a1eec758c4a575880e12bf087c805da7b9c3017..dffa1eef891299413ad279489879625eece4cf6f 100644 --- a/apidoc-core/build.gradle +++ b/apidoc-core/build.gradle @@ -2,4 +2,5 @@ dependencies { compile 'com.github.javaparser:javaparser-symbol-solver-core:3.14.4' compile 'com.fasterxml.jackson.core:jackson-databind:2.5.2' compile 'org.asciidoctor:asciidoctorj:2.1.0' + compile group: 'org.freemarker', name: 'freemarker', version: '2.3.30' } diff --git a/apidoc-core/src/main/java/kim/apidoc/core/ApiDoc.java b/apidoc-core/src/main/java/com/kim/apidoc/core/ApiDoc.java similarity index 90% rename from apidoc-core/src/main/java/kim/apidoc/core/ApiDoc.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/ApiDoc.java index fc1219920cb473e267e625fe463999383d92e664..6984ddd728c27663a4b7f0ff0beb6e8af2542674 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/ApiDoc.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/ApiDoc.java @@ -1,11 +1,11 @@ -package kim.apidoc.core; - -import kim.apidoc.core.common.helper.StringHelper; -import kim.apidoc.core.parser.ParserStrategy; -import kim.apidoc.core.parser.VisitorParser; -import kim.apidoc.core.render.ProjectRender; -import kim.apidoc.core.resolver.TypeResolvers; -import kim.apidoc.core.schema.Project; +package com.kim.apidoc.core; + +import com.kim.apidoc.core.common.helper.StringHelper; +import com.kim.apidoc.core.parser.ParserStrategy; +import com.kim.apidoc.core.parser.VisitorParser; +import com.kim.apidoc.core.render.ProjectRender; +import com.kim.apidoc.core.resolver.TypeResolvers; +import com.kim.apidoc.core.schema.Project; import com.github.javaparser.ParseResult; import com.github.javaparser.ParserConfiguration; import com.github.javaparser.ast.CompilationUnit; @@ -135,15 +135,15 @@ public class ApiDoc { if (strategies.isEmpty()) { throw new IllegalArgumentException("no ParserStrategy implements found"); } - if (StringHelper.isBlank(context.framework)) { + if (StringHelper.isBlank(context.getFramework())) { return strategies.get(0); } for (ParserStrategy strategy : strategies) { - if (Objects.equals(context.framework, strategy.name())) { + if (Objects.equals(context.getFramework(), strategy.name())) { return strategy; } } - throw new IllegalArgumentException("no ParserStrategy implements found for " + context.framework); + throw new IllegalArgumentException("no ParserStrategy implements found for " + context.getFramework()); } /** diff --git a/apidoc-core/src/main/java/kim/apidoc/core/Context.java b/apidoc-core/src/main/java/com/kim/apidoc/core/Context.java similarity index 73% rename from apidoc-core/src/main/java/kim/apidoc/core/Context.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/Context.java index 01d1ed0b71557a6c943a8386d388ada8c7b9c4a9..4b2dc19636970a6cab49335f9bd8c3f1e3f4d42d 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/Context.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/Context.java @@ -1,11 +1,12 @@ -package kim.apidoc.core; +package com.kim.apidoc.core; -import kim.apidoc.core.common.helper.FileHelper; -import kim.apidoc.core.render.AsciiDocRender; -import kim.apidoc.core.render.PostmanRender; -import kim.apidoc.core.render.ProjectRender; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import com.kim.apidoc.core.common.helper.FileHelper; +import com.kim.apidoc.core.render.AsciiDocRender; +import com.kim.apidoc.core.render.MarkdownRender; +import com.kim.apidoc.core.render.PostmanRender; +import com.kim.apidoc.core.render.ProjectRender; import lombok.Getter; import lombok.Setter; @@ -14,6 +15,8 @@ import java.nio.file.Paths; import java.util.List; import java.util.Map; +import static com.kim.apidoc.core.common.Constants.MARKDOWN_TEMPLATE; + /** * The type Context. * @@ -44,15 +47,16 @@ public class Context { * 设置当前解析框架 */ @Setter - public String framework; + private String framework; /** * The Renders. */ @Setter - public List renders = Lists.newArrayList( + private List renders = Lists.newArrayList( new AsciiDocRender(), - new PostmanRender()); + new PostmanRender(), + new MarkdownRender()); /** * 编译目录 @@ -102,17 +106,24 @@ public class Context { @Setter private String css; + + /** + * markdown模版文件路径 + */ + @Setter + private String markdownTemplate = MARKDOWN_TEMPLATE; + /** * 自定义扩展参数 */ - private Map ext= Maps.newHashMap(); + private Map ext = Maps.newHashMap(); /** * Add source. * * @param path the path */ - public void addSource(Path path){ + public void addSource(Path path) { sources.add(path); sources.addAll(FileHelper.find(path, DEFAULT_CODE_STRUCTURE)); addDependency(path); @@ -123,7 +134,7 @@ public class Context { * * @param path the path */ - public void addDependency(Path path){ + public void addDependency(Path path) { dependencies.add(path); dependencies.addAll(FileHelper.find(path, DEFAULT_CODE_STRUCTURE)); } @@ -133,10 +144,9 @@ public class Context { * * @param path the path */ - public void addJar(Path path){ + public void addJar(Path path) { jars.add(path); } - } diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/Assert.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/Assert.java similarity index 94% rename from apidoc-core/src/main/java/kim/apidoc/core/common/Assert.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/Assert.java index a98d17de84a4be9fd5600e27239c2709cd0fb539..ea8bcb297fd2a3d6116b167136249e2a2d9208bb 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/Assert.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/Assert.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common; +package com.kim.apidoc.core.common; import com.google.common.base.Strings; diff --git a/apidoc-core/src/main/java/com/kim/apidoc/core/common/Constants.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/Constants.java new file mode 100644 index 0000000000000000000000000000000000000000..a28605a47ca83d8c9b1e24fc2c1b5b4c743061a5 --- /dev/null +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/Constants.java @@ -0,0 +1,19 @@ +package com.kim.apidoc.core.common; + +import java.nio.charset.StandardCharsets; + +/** + * 常量类 + * + * @author duanledexianxianxian + * @version 1.0.0 + * @date 2020 /3/26 23:00 + * @since 1.0.0 + */ +public class Constants { + public static final String UTF8 = StandardCharsets.UTF_8.name(); + public static final String SLASH = "/"; + public static final String MARKDOWN_EXTENSION = ".md"; + public static final String MARKDOWN_TEMPLATE = "/templates/markdown.ftl"; + +} diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/ObjectMappers.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/ObjectMappers.java similarity index 96% rename from apidoc-core/src/main/java/kim/apidoc/core/common/ObjectMappers.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/ObjectMappers.java index 685cb2675022c4e7f905fe18d95d602f30f5f980..d8fa44b2cccefdcbe6f3c031fd058860cabd2342 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/ObjectMappers.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/ObjectMappers.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common; +package com.kim.apidoc.core.common; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/QueryStringBuilder.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/QueryStringBuilder.java similarity index 96% rename from apidoc-core/src/main/java/kim/apidoc/core/common/QueryStringBuilder.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/QueryStringBuilder.java index 9cfafa525618afbc46a178dbb54cf65c181bd2d8..1bfb72783e2d26fbb16bc0ae172f1cd22d6b51a2 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/QueryStringBuilder.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/QueryStringBuilder.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common; +package com.kim.apidoc.core.common; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/URI.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/URI.java similarity index 93% rename from apidoc-core/src/main/java/kim/apidoc/core/common/URI.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/URI.java index 909071c54cd8ff0ddcd34f1fa524a4fac634667a..c053981509d2bf8603e3d1446bef3a88879d9726 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/URI.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/URI.java @@ -1,6 +1,6 @@ -package kim.apidoc.core.common; +package com.kim.apidoc.core.common; -import kim.apidoc.core.common.helper.StringHelper; +import com.kim.apidoc.core.common.helper.StringHelper; import com.google.common.collect.Lists; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/description/ArrayTypeDescription.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/ArrayTypeDescription.java similarity index 95% rename from apidoc-core/src/main/java/kim/apidoc/core/common/description/ArrayTypeDescription.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/description/ArrayTypeDescription.java index 8359d867265950a3290151edfd732b5cbdb9e8d2..6ce24520916a7e8a5004dba7462d651c66517b53 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/description/ArrayTypeDescription.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/ArrayTypeDescription.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.common.description; +package com.kim.apidoc.core.common.description; -import kim.apidoc.core.common.ObjectMappers; -import kim.apidoc.core.schema.Row; +import com.kim.apidoc.core.schema.Row; +import com.kim.apidoc.core.common.ObjectMappers; import com.fasterxml.jackson.databind.node.ArrayNode; import java.util.ArrayList; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/description/ObjectTypeDescription.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/ObjectTypeDescription.java similarity index 96% rename from apidoc-core/src/main/java/kim/apidoc/core/common/description/ObjectTypeDescription.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/description/ObjectTypeDescription.java index f614fd1185f6b412944c0bab26d850874db0e47a..d3a07c7e43286b73992dc5e8edc4cf8f904adcb4 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/description/ObjectTypeDescription.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/ObjectTypeDescription.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.common.description; +package com.kim.apidoc.core.common.description; -import kim.apidoc.core.common.ObjectMappers; -import kim.apidoc.core.schema.Row; +import com.kim.apidoc.core.schema.Row; +import com.kim.apidoc.core.common.ObjectMappers; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.common.collect.Lists; import lombok.Getter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/description/PrimitiveTypeDescription.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/PrimitiveTypeDescription.java similarity index 97% rename from apidoc-core/src/main/java/kim/apidoc/core/common/description/PrimitiveTypeDescription.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/description/PrimitiveTypeDescription.java index 0eb349e1dca943836e0cc8460444ea3cc098f17a..56d88b2d2745dd5773ed0e30cd1a447773a071c2 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/description/PrimitiveTypeDescription.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/PrimitiveTypeDescription.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.description; +package com.kim.apidoc.core.common.description; import com.github.javaparser.resolution.types.ResolvedPrimitiveType; import com.github.javaparser.resolution.types.ResolvedReferenceType; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/description/StringTypeDescription.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/StringTypeDescription.java similarity index 86% rename from apidoc-core/src/main/java/kim/apidoc/core/common/description/StringTypeDescription.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/description/StringTypeDescription.java index f8d589bab3b63419f39f7c3148151496255b2252..81ba7db454c038f3e00f27e0081db41f3d6cbf22 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/description/StringTypeDescription.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/StringTypeDescription.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.description; +package com.kim.apidoc.core.common.description; public class StringTypeDescription extends TypeDescription { diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/description/TypeDescription.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/TypeDescription.java similarity index 94% rename from apidoc-core/src/main/java/kim/apidoc/core/common/description/TypeDescription.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/description/TypeDescription.java index 57b7cc9899e73d93f58a6d14af27b30c687ae784..77718981988483b159d28fe8dcdf57bc73848610 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/description/TypeDescription.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/TypeDescription.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.common.description; +package com.kim.apidoc.core.common.description; -import kim.apidoc.core.common.helper.StringHelper; -import kim.apidoc.core.schema.Row; +import com.kim.apidoc.core.schema.Row; +import com.kim.apidoc.core.common.helper.StringHelper; import com.google.common.collect.Lists; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/description/UnAvailableTypeDescription.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/UnAvailableTypeDescription.java similarity index 83% rename from apidoc-core/src/main/java/kim/apidoc/core/common/description/UnAvailableTypeDescription.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/description/UnAvailableTypeDescription.java index d40e90eced44253601cbe9b9c5beb59cc5c1e87f..a2941211598b7b3ae657564818a9e3f4880cd851 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/description/UnAvailableTypeDescription.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/description/UnAvailableTypeDescription.java @@ -1,6 +1,6 @@ -package kim.apidoc.core.common.description; +package com.kim.apidoc.core.common.description; -import kim.apidoc.core.schema.Row; +import com.kim.apidoc.core.schema.Row; import java.util.Collection; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/diff/FileMatcher.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/diff/FileMatcher.java similarity index 98% rename from apidoc-core/src/main/java/kim/apidoc/core/common/diff/FileMatcher.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/diff/FileMatcher.java index 52b5806f9164b69e5c8d4e0fb63ba6e340287f5a..14031b8d23e658b0e63341f6ba94b2ecbb2c5246 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/diff/FileMatcher.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/diff/FileMatcher.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.diff; +package com.kim.apidoc.core.common.diff; import com.google.common.base.Charsets; import lombok.Getter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/diff/FileSystem.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/diff/FileSystem.java similarity index 97% rename from apidoc-core/src/main/java/kim/apidoc/core/common/diff/FileSystem.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/diff/FileSystem.java index 447274b5a02fde6847ccbf9cbb6a3e6cf20c39ed..0f6115f5c8e50e2e648fbaad44c3525f78513d19 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/diff/FileSystem.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/diff/FileSystem.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.diff; +package com.kim.apidoc.core.common.diff; import java.awt.*; import java.io.File; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/diff/MatchPatcher.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/diff/MatchPatcher.java similarity index 99% rename from apidoc-core/src/main/java/kim/apidoc/core/common/diff/MatchPatcher.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/diff/MatchPatcher.java index 0d0da4bc588c2cf6a406a6e4d8a3aecbc66e1b90..311bf40b66a4f66c43aa8609389969fb97465090 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/diff/MatchPatcher.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/diff/MatchPatcher.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package kim.apidoc.core.common.diff; +package com.kim.apidoc.core.common.diff; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/AnnotationHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/AnnotationHelper.java similarity index 97% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/AnnotationHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/AnnotationHelper.java index 4304fec5608b1dba3dfaf9a342867891d74f833c..3f1aecc91e68ebd831829131d97333199ddf4199 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/AnnotationHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/AnnotationHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.github.javaparser.ast.expr.*; import com.github.javaparser.ast.nodeTypes.NodeWithAnnotations; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/ClassDeclarationHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ClassDeclarationHelper.java similarity index 97% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/ClassDeclarationHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ClassDeclarationHelper.java index cc0a05fbc6d2b478e8d81ee06a3a3fa274f07636..2734e86d1326e0ee71208382301ae7247d643737 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/ClassDeclarationHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ClassDeclarationHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.body.FieldDeclaration; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/CommentHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/CommentHelper.java similarity index 98% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/CommentHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/CommentHelper.java index 86234f2e97f7dac8cdf774ce67bfd1bf15fda942..5bebdc37256bbbf7e568f781cfbc8a781dd309bc 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/CommentHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/CommentHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.github.javaparser.ast.body.FieldDeclaration; import com.github.javaparser.ast.body.MethodDeclaration; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/CompilationUnitHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/CompilationUnitHelper.java similarity index 92% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/CompilationUnitHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/CompilationUnitHelper.java index 5cd759171ea9c48c14fc3e56e17c8566190f31ac..1fe7fd5e07268af4f53cf3a1b8828cfbfc0be70f 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/CompilationUnitHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/CompilationUnitHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.Node; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/ExpressionHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ExpressionHelper.java similarity index 98% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/ExpressionHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ExpressionHelper.java index 13adf03728573a7fd19dd6c94302b2645b9007a5..a20830915d594f531d4b7111bee381363f102f8c 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/ExpressionHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ExpressionHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.expr.*; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/FieldHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/FieldHelper.java similarity index 96% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/FieldHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/FieldHelper.java index fcb8c5358e0c6d42a61597104c933e2c270e8537..598b21475d71250b334f1572f9be0480360ef6ed 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/FieldHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/FieldHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.github.javaparser.ast.expr.Expression; import com.github.javaparser.resolution.declarations.ResolvedFieldDeclaration; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/FileHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/FileHelper.java similarity index 85% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/FileHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/FileHelper.java index 7a780362ff5cf30f317b550d67e7b2cbdc2d03c5..59247b8302795e5f55c636dfc44d67dd63906dcf 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/FileHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/FileHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; @@ -32,10 +32,10 @@ public class FileHelper { } } - public static List find(Path start, String structure){ + public static List find(Path start, String structure) { try { return Files.walk(start) - .filter(p->p.endsWith(structure)).collect(Collectors.toList()); + .filter(p -> p.endsWith(structure)).collect(Collectors.toList()); } catch (IOException e) { log.warn("find path error:{} {}", start, e.getMessage()); } diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/JsonPropertyHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/JsonPropertyHelper.java similarity index 97% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/JsonPropertyHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/JsonPropertyHelper.java index 63c748a33bb75c190790fe1ae80f2e46afa53edc..447b79da1ecbb2db6f366946cdf1adb0a4feceb7 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/JsonPropertyHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/JsonPropertyHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.github.javaparser.ast.body.FieldDeclaration; import com.github.javaparser.ast.expr.AnnotationExpr; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/OptionalHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/OptionalHelper.java similarity index 88% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/OptionalHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/OptionalHelper.java index 661243d053b931c4dcbd3faea249f2af17cf5c46..a99b6ec73038d6bd0a0fb802f8413db60151dc20 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/OptionalHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/OptionalHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import java.util.Optional; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/ReferenceContext.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ReferenceContext.java similarity index 94% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/ReferenceContext.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ReferenceContext.java index 20daa4003c59902da6d0dea9aed2b68a5bfebacd..8ef8fcdd10b8977d351096238518d2784b3ac56f 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/ReferenceContext.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ReferenceContext.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.google.common.collect.Sets; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/StringHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/StringHelper.java similarity index 96% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/StringHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/StringHelper.java index 08e98fecde7b66c21e357d3ae92dcacc7c1ff69b..b6c309325f759de0455d172c5b11845bea46b043 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/StringHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/StringHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.google.common.base.Strings; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/TypeNameHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/TypeNameHelper.java similarity index 97% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/TypeNameHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/TypeNameHelper.java index 38efcaf93321e99709eab27e241f7b3436b3fb65..64fef127a6f9e7d749f6c5a753a326a4ecc70caf 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/TypeNameHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/TypeNameHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.ImportDeclaration; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/TypeParameterHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/TypeParameterHelper.java similarity index 98% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/TypeParameterHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/TypeParameterHelper.java index 722d0b0f9ac59f713536f2e5171f5892b359e76c..42ad047dab77db349e184d65ca97a84e4cbc9e10 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/TypeParameterHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/TypeParameterHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration; import com.github.javaparser.resolution.types.ResolvedReferenceType; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/ValidationHelper.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ValidationHelper.java similarity index 97% rename from apidoc-core/src/main/java/kim/apidoc/core/common/helper/ValidationHelper.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ValidationHelper.java index 0d42101ec92bc8a62035b85982a3a98122f6f9fc..44f849bc465598f3b20ca57863189e527e2edd35 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/helper/ValidationHelper.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/helper/ValidationHelper.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.helper; +package com.kim.apidoc.core.common.helper; import com.github.javaparser.ast.body.FieldDeclaration; import com.github.javaparser.ast.expr.AnnotationExpr; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/MarkupBuilder.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/MarkupBuilder.java similarity index 97% rename from apidoc-core/src/main/java/kim/apidoc/core/common/markup/MarkupBuilder.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/MarkupBuilder.java index 0dd0a03d7790b7f8f65410b6d94218feb5c0c4bc..629ef8f45992864752c9923df370435aab897771 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/MarkupBuilder.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/MarkupBuilder.java @@ -1,6 +1,6 @@ -package kim.apidoc.core.common.markup; +package com.kim.apidoc.core.common.markup; -import kim.apidoc.core.common.markup.asciidoc.AsciiDocBuilder; +import com.kim.apidoc.core.common.markup.asciidoc.AsciiDocBuilder; import java.util.List; import java.util.function.Consumer; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/asciidoc/AsciiDoc.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/asciidoc/AsciiDoc.java similarity index 97% rename from apidoc-core/src/main/java/kim/apidoc/core/common/markup/asciidoc/AsciiDoc.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/asciidoc/AsciiDoc.java index 18e4ca4fbecb72ba53f424a8617c71fb1e3e9b1d..c114e5ea3c7c186284e7805d7b91f7f4a4883228 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/asciidoc/AsciiDoc.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/asciidoc/AsciiDoc.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.markup.asciidoc; +package com.kim.apidoc.core.common.markup.asciidoc; public enum AsciiDoc implements CharSequence { EXTENSION(".adoc"), diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/asciidoc/AsciiDocBuilder.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/asciidoc/AsciiDocBuilder.java similarity index 98% rename from apidoc-core/src/main/java/kim/apidoc/core/common/markup/asciidoc/AsciiDocBuilder.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/asciidoc/AsciiDocBuilder.java index 5d95e67a0d69a81907f4ff42a6b9035e78555bf8..9642f9aef5fae1bcd22c20b764ebbefbd0cf61a9 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/asciidoc/AsciiDocBuilder.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/asciidoc/AsciiDocBuilder.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.common.markup.asciidoc; +package com.kim.apidoc.core.common.markup.asciidoc; -import kim.apidoc.core.common.Assert; -import kim.apidoc.core.common.markup.MarkupBuilder; +import com.kim.apidoc.core.common.markup.MarkupBuilder; +import com.kim.apidoc.core.common.Assert; import com.google.common.base.Strings; import java.util.List; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/asciidoc/Color.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/asciidoc/Color.java similarity index 94% rename from apidoc-core/src/main/java/kim/apidoc/core/common/markup/asciidoc/Color.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/asciidoc/Color.java index 301f70e651886ae45864ff413165f1fbb3f98735..b7ca387286535527ab11937c0321c7b5297ab7e7 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/asciidoc/Color.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/asciidoc/Color.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.markup.asciidoc; +package com.kim.apidoc.core.common.markup.asciidoc; /** * https://en.wikipedia.org/wiki/Web_colors#HTML_color_names diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/markdown/Markdown.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/markdown/Markdown.java similarity index 96% rename from apidoc-core/src/main/java/kim/apidoc/core/common/markup/markdown/Markdown.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/markdown/Markdown.java index 22f00147c86f26352ff50fd526f04ca2fca4cea3..8fdb93f53ea61e7dc011180d474b6bfeaaad601e 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/markdown/Markdown.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/markdown/Markdown.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.markup.markdown; +package com.kim.apidoc.core.common.markup.markdown; public enum Markdown implements CharSequence { EXTENSION(".md"), diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/markdown/MarkdownBuilder.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/markdown/MarkdownBuilder.java similarity index 98% rename from apidoc-core/src/main/java/kim/apidoc/core/common/markup/markdown/MarkdownBuilder.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/markdown/MarkdownBuilder.java index 2b012d59b5bdbd60e5d145870773ea9d87cb4511..1c80669a90cc8e4f24a898b7d1e70610d9cb6b52 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/markup/markdown/MarkdownBuilder.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/markup/markdown/MarkdownBuilder.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.common.markup.markdown; +package com.kim.apidoc.core.common.markup.markdown; -import kim.apidoc.core.common.Assert; -import kim.apidoc.core.common.markup.MarkupBuilder; +import com.kim.apidoc.core.common.markup.MarkupBuilder; +import com.kim.apidoc.core.common.Assert; import com.google.common.base.Strings; import java.util.List; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Body.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Body.java similarity index 86% rename from apidoc-core/src/main/java/kim/apidoc/core/common/postman/Body.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Body.java index 47487e575bb2b7370a7a29333a7129290a7c853d..b3a32fe1654965a7601709bc91fd3b54ce2c82ea 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Body.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Body.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.postman; +package com.kim.apidoc.core.common.postman; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/BodyMode.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/BodyMode.java similarity index 69% rename from apidoc-core/src/main/java/kim/apidoc/core/common/postman/BodyMode.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/BodyMode.java index 7d56b3c4e50f4ee16dacce10222fa037ec5a74c0..3972bd9604353f36456fb89d58ac55765044e78f 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/BodyMode.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/BodyMode.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.postman; +package com.kim.apidoc.core.common.postman; /** * 对应postman定义的mode diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Folder.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Folder.java similarity index 87% rename from apidoc-core/src/main/java/kim/apidoc/core/common/postman/Folder.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Folder.java index 8620ef9c34ec38bceea73d8ad56b51954cea2390..be112fb94449485d9fd5538e1d6d8a2361479b8e 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Folder.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Folder.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.postman; +package com.kim.apidoc.core.common.postman; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Getter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Info.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Info.java similarity index 85% rename from apidoc-core/src/main/java/kim/apidoc/core/common/postman/Info.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Info.java index 5fceb856b60eff85f9a7d5a00013b31c90d23be0..32ea847f0d21fb5d7dc9c329118507682fde4362 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Info.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Info.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.postman; +package com.kim.apidoc.core.common.postman; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Item.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Item.java similarity index 89% rename from apidoc-core/src/main/java/kim/apidoc/core/common/postman/Item.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Item.java index 4a25b191da786339d5db137acb69e5102567a05a..9cd90f5fe38947f39fd5e0aa262f83470561d364 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Item.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Item.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.postman; +package com.kim.apidoc.core.common.postman; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Parameter.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Parameter.java similarity index 85% rename from apidoc-core/src/main/java/kim/apidoc/core/common/postman/Parameter.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Parameter.java index 5f3baf7637e6e3fc0be678e9f464df9f87470658..26f8aaa040f1327d3a7bb4e4514d68e78c75d4cd 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Parameter.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Parameter.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.common.postman; +package com.kim.apidoc.core.common.postman; -import kim.apidoc.core.schema.Row; +import com.kim.apidoc.core.schema.Row; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Postman.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Postman.java similarity index 88% rename from apidoc-core/src/main/java/kim/apidoc/core/common/postman/Postman.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Postman.java index 549e7a9a315a0cf688bf45fe2f190338a4160e0b..1d6be5db89f241dfe7fde49aaf918f44f3d69b51 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Postman.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Postman.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.postman; +package com.kim.apidoc.core.common.postman; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Request.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Request.java similarity index 68% rename from apidoc-core/src/main/java/kim/apidoc/core/common/postman/Request.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Request.java index 6ddf403cfbce920e6b114eb4c1b93316c91efd7a..e54cbcb5291835771db69233ba75c6839207d430 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Request.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Request.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.common.postman; +package com.kim.apidoc.core.common.postman; -import kim.apidoc.core.schema.Header; -import kim.apidoc.core.schema.Method; +import com.kim.apidoc.core.schema.Header; +import com.kim.apidoc.core.schema.Method; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Response.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Response.java similarity index 79% rename from apidoc-core/src/main/java/kim/apidoc/core/common/postman/Response.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Response.java index 3854cda0f508b355ffbdea2c1b0ee7a69a6a35ec..b8ef7390653b6e49f90af5581ba40d8184fa563b 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Response.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Response.java @@ -1,6 +1,6 @@ -package kim.apidoc.core.common.postman; +package com.kim.apidoc.core.common.postman; -import kim.apidoc.core.schema.Header; +import com.kim.apidoc.core.schema.Header; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Url.java b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Url.java similarity index 86% rename from apidoc-core/src/main/java/kim/apidoc/core/common/postman/Url.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Url.java index 5fc565dcd4fd4cf0844ecaea9c862acb5363396c..3cb84e055a4bdeb23977dc4ea06726ba1e194924 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/common/postman/Url.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/common/postman/Url.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.common.postman; +package com.kim.apidoc.core.common.postman; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/parser/ParserStrategy.java b/apidoc-core/src/main/java/com/kim/apidoc/core/parser/ParserStrategy.java similarity index 89% rename from apidoc-core/src/main/java/kim/apidoc/core/parser/ParserStrategy.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/parser/ParserStrategy.java index 699a3a0c786aa7f0e462cc8c812dac0634509ce3..f7e3331b1e43b5b01940667535f8603bd886aad0 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/parser/ParserStrategy.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/parser/ParserStrategy.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.parser; +package com.kim.apidoc.core.parser; -import kim.apidoc.core.schema.Chapter; -import kim.apidoc.core.schema.Section; +import com.kim.apidoc.core.schema.Chapter; +import com.kim.apidoc.core.schema.Section; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.body.MethodDeclaration; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/parser/VisitorParser.java b/apidoc-core/src/main/java/com/kim/apidoc/core/parser/VisitorParser.java similarity index 90% rename from apidoc-core/src/main/java/kim/apidoc/core/parser/VisitorParser.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/parser/VisitorParser.java index 8567ecca65aea120de997937edbd0c24d1717781..cb4176b78e09ba91e2451b4eea156bd3baf8757a 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/parser/VisitorParser.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/parser/VisitorParser.java @@ -1,10 +1,10 @@ -package kim.apidoc.core.parser; +package com.kim.apidoc.core.parser; -import kim.apidoc.core.common.helper.OptionalHelper; -import kim.apidoc.core.schema.Chapter; -import kim.apidoc.core.schema.Node; -import kim.apidoc.core.schema.Project; -import kim.apidoc.core.schema.Section; +import com.kim.apidoc.core.schema.Chapter; +import com.kim.apidoc.core.schema.Node; +import com.kim.apidoc.core.schema.Project; +import com.kim.apidoc.core.schema.Section; +import com.kim.apidoc.core.common.helper.OptionalHelper; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.visitor.VoidVisitorAdapter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/render/AsciiDocRender.java b/apidoc-core/src/main/java/com/kim/apidoc/core/render/AsciiDocRender.java similarity index 90% rename from apidoc-core/src/main/java/kim/apidoc/core/render/AsciiDocRender.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/render/AsciiDocRender.java index c1e7b249dd5f9788d6a3e8753ea61f0e19f7ae7b..491dc2ea260268b21a18114333e5def5b329477d 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/render/AsciiDocRender.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/render/AsciiDocRender.java @@ -1,12 +1,12 @@ -package kim.apidoc.core.render; +package com.kim.apidoc.core.render; -import kim.apidoc.core.ApiDoc; -import kim.apidoc.core.common.helper.FileHelper; -import kim.apidoc.core.common.helper.StringHelper; -import kim.apidoc.core.common.markup.MarkupBuilder; -import kim.apidoc.core.common.markup.asciidoc.AsciiDoc; import com.google.common.collect.Lists; -import kim.apidoc.core.schema.*; +import com.kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.common.helper.FileHelper; +import com.kim.apidoc.core.common.helper.StringHelper; +import com.kim.apidoc.core.common.markup.MarkupBuilder; +import com.kim.apidoc.core.common.markup.asciidoc.AsciiDoc; +import com.kim.apidoc.core.schema.*; import lombok.extern.slf4j.Slf4j; import org.asciidoctor.Asciidoctor; import org.asciidoctor.AttributesBuilder; @@ -46,7 +46,7 @@ public class AsciiDocRender implements ProjectRender { project.getBooks().forEach((name, book) -> { MarkupBuilder builder = MarkupBuilder.getInstance(); String displayName = project.getName(); - if(!Objects.equals(Book.DEFAULT, name)){ + if (!Objects.equals(Book.DEFAULT, name)) { displayName += " - " + name; } builder.header(displayName, attrs); @@ -61,7 +61,7 @@ public class AsciiDocRender implements ProjectRender { builder.title(1, chapter.getName()); builder.paragraph(chapter.getDescription()); for (Section section : chapter.getSections()) { - if(section.isIgnore()){ + if (section.isIgnore()) { continue; } builder.title(2, section.getName()); @@ -71,7 +71,7 @@ public class AsciiDocRender implements ProjectRender { builder.title(4, "request"); builder.listing(b -> { b.textLine(section.getRequestLine()); - section.getInHeaders().values().forEach(header->builder.textLine(header.toString())); + section.getInHeaders().values().forEach(header -> builder.textLine(header.toString())); if (section.hasRequestBody()) { b.br(); b.text(section.getParameterString()); @@ -87,7 +87,7 @@ public class AsciiDocRender implements ProjectRender { if (section.hasResponseBody()) { b.br(); b.text(section.getResponseString()); - }else{ + } else { b.text("N/A"); } }, "source,JSON"); diff --git a/apidoc-core/src/main/java/com/kim/apidoc/core/render/MarkdownRender.java b/apidoc-core/src/main/java/com/kim/apidoc/core/render/MarkdownRender.java new file mode 100644 index 0000000000000000000000000000000000000000..b5d698d33b03ed6eaf3739b5eacc0b1ce6d8d57c --- /dev/null +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/render/MarkdownRender.java @@ -0,0 +1,60 @@ +package com.kim.apidoc.core.render; + +import com.kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.common.Constants; +import com.kim.apidoc.core.schema.Project; +import freemarker.template.Configuration; +import freemarker.template.Template; +import lombok.extern.slf4j.Slf4j; + +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.nio.file.Path; + + +/** + * 生成markdown api文档 + * + * @author duanledexianxianxian + * @version 1.0.0 + * @date 2020 /3/26 19:03 + * @since 1.0.0 + */ +@Slf4j +public class MarkdownRender implements ProjectRender { + private Configuration configuration; + + public MarkdownRender init() { + configuration = new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS); + configuration.setDefaultEncoding(Constants.UTF8); + configuration.setClassForTemplateLoading(MarkdownRender.class, Constants.SLASH); + return this; + } + + + @Override + public void render(Project project) { + this.init(); + try { + this.build(project); + } catch (Exception e) { + log.error("Build Markdown Fail {}", e.getMessage()); + } + } + + private void build(Project project) throws Exception { + String templatePath = ApiDoc.getInstance().getContext().getMarkdownTemplate(); + String id = ApiDoc.getInstance().getContext().getId(); + Path buildPath = ApiDoc.getInstance().getContext().getBuildPath(); + Path markdownFile = buildPath.resolve(id).resolve(id + Constants.MARKDOWN_EXTENSION); + + Template template = configuration.getTemplate(templatePath); + + try (FileOutputStream fileOutputStream = new FileOutputStream(markdownFile.toString())) { + template.process(project, new OutputStreamWriter(fileOutputStream, Constants.UTF8)); + } + + log.info("Build Markdown {}", markdownFile); + + } +} diff --git a/apidoc-core/src/main/java/kim/apidoc/core/render/PostmanRender.java b/apidoc-core/src/main/java/com/kim/apidoc/core/render/PostmanRender.java similarity index 83% rename from apidoc-core/src/main/java/kim/apidoc/core/render/PostmanRender.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/render/PostmanRender.java index 1afe2df0c8db978a78c2346995f6749390a92e79..325add5b80981953b01835b6f06739aa7cd8b802 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/render/PostmanRender.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/render/PostmanRender.java @@ -1,11 +1,11 @@ -package kim.apidoc.core.render; +package com.kim.apidoc.core.render; import com.fasterxml.jackson.databind.node.ObjectNode; -import kim.apidoc.core.ApiDoc; -import kim.apidoc.core.common.ObjectMappers; -import kim.apidoc.core.common.helper.FileHelper; -import kim.apidoc.core.common.postman.*; -import kim.apidoc.core.schema.*; +import com.kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.common.ObjectMappers; +import com.kim.apidoc.core.common.helper.FileHelper; +import com.kim.apidoc.core.common.postman.*; +import com.kim.apidoc.core.schema.*; import lombok.extern.slf4j.Slf4j; import java.nio.file.Path; @@ -38,14 +38,14 @@ public class PostmanRender implements ProjectRender { Folder folder = new Folder(); folder.setName(book.getId()); for (Chapter chapter : book.getChapters()) { - if(chapter.isIgnore() || chapter.getSections().isEmpty()){ + if (chapter.isIgnore() || chapter.getSections().isEmpty()) { continue; } Folder chapterFolder = new Folder(); chapterFolder.setName(chapter.getName()); chapterFolder.setDescription(chapter.getDescription()); for (Section section : chapter.getSections()) { - if(section.isIgnore()){ + if (section.isIgnore()) { continue; } chapterFolder.getItem().add(build(section)); @@ -55,7 +55,7 @@ public class PostmanRender implements ProjectRender { postman.getItem().add(folder); } - if(postman.getItem().size()==1){ + if (postman.getItem().size() == 1) { Folder folder = postman.getItem().get(0); postman.setItem(folder.getItem()); } @@ -74,18 +74,18 @@ public class PostmanRender implements ProjectRender { request.setMethod(section.getMethod()); request.getHeaders().addAll(section.getInHeaders().values()); - if(section.isQueryParameter()){ - if(Method.GET.equals(request.getMethod())){ - ObjectNode objectNode = (ObjectNode)section.getParameter(); + if (section.isQueryParameter()) { + if (Method.GET.equals(request.getMethod())) { + ObjectNode objectNode = (ObjectNode) section.getParameter(); for (String key : section.getRequestRows().keySet()) { if (objectNode.has(key)) { Row row = section.getRequestRows().get(key); request.getUrl().getQuery().add(Parameter.of(row)); } } - }else{ + } else { request.getBody().setMode(BodyMode.urlencoded); - ObjectNode objectNode = (ObjectNode)section.getParameter(); + ObjectNode objectNode = (ObjectNode) section.getParameter(); for (String key : section.getRequestRows().keySet()) { if (objectNode.has(key)) { Row row = section.getRequestRows().get(key); @@ -93,7 +93,7 @@ public class PostmanRender implements ProjectRender { } } } - }else{ + } else { request.getBody().setMode(BodyMode.raw); request.getBody().setRaw(section.getParameterString()); } diff --git a/apidoc-core/src/main/java/kim/apidoc/core/render/ProjectRender.java b/apidoc-core/src/main/java/com/kim/apidoc/core/render/ProjectRender.java similarity index 72% rename from apidoc-core/src/main/java/kim/apidoc/core/render/ProjectRender.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/render/ProjectRender.java index 2e126666f448a2f0cfcefd7808ca01ddc57e0977..c2c36614085fd56a5dbd5abb4e388194a0f8f5a6 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/render/ProjectRender.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/render/ProjectRender.java @@ -1,6 +1,6 @@ -package kim.apidoc.core.render; +package com.kim.apidoc.core.render; -import kim.apidoc.core.schema.Project; +import com.kim.apidoc.core.schema.Project; /** * The interface Project render. diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/ArrayTypeResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/ArrayTypeResolver.java similarity index 67% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/ArrayTypeResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/ArrayTypeResolver.java index db9e2c6913183603098cac52dce0facd2ad721f5..76f2296902ca52a688a0c1028faae3faf3b98753 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/ArrayTypeResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/ArrayTypeResolver.java @@ -1,8 +1,8 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.ApiDoc; -import kim.apidoc.core.common.description.TypeDescription; -import kim.apidoc.core.common.description.ArrayTypeDescription; +import com.kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.ArrayTypeDescription; import com.github.javaparser.resolution.types.ResolvedType; public class ArrayTypeResolver implements TypeResolver { diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/CollectionTypeResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/CollectionTypeResolver.java similarity index 78% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/CollectionTypeResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/CollectionTypeResolver.java index 89e6356f3597bd0b232099b47547fff74fbde7d3..f08cc10600e58f4f2d8af1ad7d0288d17b2588be 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/CollectionTypeResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/CollectionTypeResolver.java @@ -1,10 +1,10 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.ApiDoc; -import kim.apidoc.core.common.helper.TypeParameterHelper; -import kim.apidoc.core.common.description.ArrayTypeDescription; -import kim.apidoc.core.common.description.TypeDescription; -import kim.apidoc.core.common.description.UnAvailableTypeDescription; +import com.kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.common.helper.TypeParameterHelper; +import com.kim.apidoc.core.common.description.ArrayTypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.UnAvailableTypeDescription; import com.github.javaparser.resolution.types.ResolvedType; import com.google.common.collect.ImmutableList; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/DateTypeResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/DateTypeResolver.java similarity index 83% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/DateTypeResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/DateTypeResolver.java index b163b84fe80dc4328ff0ff3688de639ba6d411ef..9c9f20ddbee5bf1f7379c80ee79e8005f5fb88fa 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/DateTypeResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/DateTypeResolver.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.common.description.TypeDescription; -import kim.apidoc.core.common.description.StringTypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.StringTypeDescription; import com.github.javaparser.resolution.types.ResolvedType; import com.google.common.collect.ImmutableList; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/EnumTypeResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/EnumTypeResolver.java similarity index 84% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/EnumTypeResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/EnumTypeResolver.java index 613803396bc2df374d1787127ba942afe7007d32..306f27cef3860c58b87896b9c9462ac8a63f72a3 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/EnumTypeResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/EnumTypeResolver.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.common.description.StringTypeDescription; -import kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.StringTypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; import com.github.javaparser.resolution.declarations.ResolvedEnumConstantDeclaration; import com.github.javaparser.resolution.declarations.ResolvedEnumDeclaration; import com.github.javaparser.resolution.types.ResolvedType; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/MapTypeResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/MapTypeResolver.java similarity index 84% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/MapTypeResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/MapTypeResolver.java index 9cba7e118263a9de9d0a1417e3a89d911423f077..8118dab205e1efde3dd6aaf45722c0aa9f11c878 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/MapTypeResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/MapTypeResolver.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.common.description.TypeDescription; -import kim.apidoc.core.common.description.UnAvailableTypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.UnAvailableTypeDescription; import com.github.javaparser.resolution.types.ResolvedType; import com.google.common.collect.ImmutableList; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/ObjectTypeResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/ObjectTypeResolver.java similarity index 92% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/ObjectTypeResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/ObjectTypeResolver.java index b9302f976c61c1a719a2c02db1727a96915cd44a..cee038cca20dd26c30e985ae28d10eaefaadc543 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/ObjectTypeResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/ObjectTypeResolver.java @@ -1,12 +1,12 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; import com.github.javaparser.resolution.declarations.ResolvedFieldDeclaration; import com.github.javaparser.resolution.types.ResolvedReferenceType; import com.github.javaparser.resolution.types.ResolvedType; -import kim.apidoc.core.ApiDoc; -import kim.apidoc.core.common.description.ObjectTypeDescription; -import kim.apidoc.core.common.description.TypeDescription; -import kim.apidoc.core.common.helper.*; +import com.kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.common.description.ObjectTypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.helper.*; import java.util.Optional; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/PrimitiveTypeResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/PrimitiveTypeResolver.java similarity index 86% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/PrimitiveTypeResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/PrimitiveTypeResolver.java index cdd456b013db60a102efb75f320aeb4361e10807..36e4123488faac418220dd5146475ecd405ecb6f 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/PrimitiveTypeResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/PrimitiveTypeResolver.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.common.description.PrimitiveTypeDescription; -import kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.PrimitiveTypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; import com.github.javaparser.resolution.types.ResolvedType; import com.google.common.collect.ImmutableList; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/StringTypeResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/StringTypeResolver.java similarity index 81% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/StringTypeResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/StringTypeResolver.java index b2942c49a44c5c2331aedabbdee2c8ce4976e711..295444449d4c7551ff50ff2ec92d28c6f1362bf1 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/StringTypeResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/StringTypeResolver.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.common.description.TypeDescription; -import kim.apidoc.core.common.description.StringTypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.StringTypeDescription; import com.github.javaparser.resolution.types.ResolvedType; import com.google.common.collect.ImmutableList; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/SystemObjectTypeResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/SystemObjectTypeResolver.java similarity index 79% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/SystemObjectTypeResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/SystemObjectTypeResolver.java index 5fe5e565976882135f6e991c8276f4d052e1b7fb..da8ffb333119857b14b42e431ad4fd04019af5e5 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/SystemObjectTypeResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/SystemObjectTypeResolver.java @@ -1,7 +1,7 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.common.description.TypeDescription; -import kim.apidoc.core.common.description.UnAvailableTypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.UnAvailableTypeDescription; import com.github.javaparser.resolution.types.ResolvedType; public class SystemObjectTypeResolver implements TypeResolver { diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/TypeNameResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/TypeNameResolver.java similarity index 61% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/TypeNameResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/TypeNameResolver.java index 7a12503427889e4028263ea83c0bf06dc18472e0..92efd8e9f2b3a9b9e5baed20f28088949fd62cb8 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/TypeNameResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/TypeNameResolver.java @@ -1,6 +1,6 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; import com.github.javaparser.ast.type.Type; public interface TypeNameResolver { diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/TypeResolver.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/TypeResolver.java similarity index 64% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/TypeResolver.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/TypeResolver.java index 469a6916c05020e8beab1310f34af58045e800c1..3d9a3c742bd353c36781925b29603a3993d3f83c 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/TypeResolver.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/TypeResolver.java @@ -1,6 +1,6 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; import com.github.javaparser.resolution.types.ResolvedType; public interface TypeResolver { diff --git a/apidoc-core/src/main/java/kim/apidoc/core/resolver/TypeResolvers.java b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/TypeResolvers.java similarity index 91% rename from apidoc-core/src/main/java/kim/apidoc/core/resolver/TypeResolvers.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/resolver/TypeResolvers.java index fc8a6b1ce656d9bca5b9514734e964fcb8f54070..bc220d9e42a5f28d8f963f9cec703d8286d2aa0f 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/resolver/TypeResolvers.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/resolver/TypeResolvers.java @@ -1,8 +1,8 @@ -package kim.apidoc.core.resolver; +package com.kim.apidoc.core.resolver; -import kim.apidoc.core.common.description.TypeDescription; -import kim.apidoc.core.common.helper.TypeNameHelper; -import kim.apidoc.core.common.description.UnAvailableTypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.helper.TypeNameHelper; +import com.kim.apidoc.core.common.description.UnAvailableTypeDescription; import com.github.javaparser.ast.type.Type; import com.github.javaparser.resolution.UnsolvedSymbolException; import com.github.javaparser.resolution.types.ResolvedType; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/schema/Book.java b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Book.java similarity index 93% rename from apidoc-core/src/main/java/kim/apidoc/core/schema/Book.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/schema/Book.java index 99b9eddefef6863228e85f30ff96e0e5d46b19b8..dfd2da2e0ae5f304c6d67c2a417270df8bc69ea7 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/schema/Book.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Book.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.schema; +package com.kim.apidoc.core.schema; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/schema/Chapter.java b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Chapter.java similarity index 91% rename from apidoc-core/src/main/java/kim/apidoc/core/schema/Chapter.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/schema/Chapter.java index 59e699d6d45876278d64af6036e6ced381ab494b..e65bda37313f7c3a3580a1165895262206ff3619 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/schema/Chapter.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Chapter.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.schema; +package com.kim.apidoc.core.schema; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/schema/Header.java b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Header.java similarity index 97% rename from apidoc-core/src/main/java/kim/apidoc/core/schema/Header.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/schema/Header.java index 962f0f21f08a16ef3c46f4518382d9f31d86ee8e..cd99d6402470ea8337f30a1bd713e0f41b1759c2 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/schema/Header.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Header.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.schema; +package com.kim.apidoc.core.schema; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/schema/Method.java b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Method.java similarity index 96% rename from apidoc-core/src/main/java/kim/apidoc/core/schema/Method.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/schema/Method.java index 4cf18f6372119525e7e0d75f4400620dda24fb37..31c09d71a307bcb80dae904c61f1edd38e05d336 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/schema/Method.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Method.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.schema; +package com.kim.apidoc.core.schema; import lombok.extern.slf4j.Slf4j; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/schema/Node.java b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Node.java similarity index 94% rename from apidoc-core/src/main/java/kim/apidoc/core/schema/Node.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/schema/Node.java index 0abf6c1f287c9a6cb2305efc13b9ebdf9c5a3347..d887a0b738d136ead1ea7717ca9b4e2d8fe6669d 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/schema/Node.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Node.java @@ -1,8 +1,8 @@ -package kim.apidoc.core.schema; +package com.kim.apidoc.core.schema; -import kim.apidoc.core.Context; -import kim.apidoc.core.common.helper.CommentHelper; -import kim.apidoc.core.common.helper.StringHelper; +import com.kim.apidoc.core.Context; +import com.kim.apidoc.core.common.helper.CommentHelper; +import com.kim.apidoc.core.common.helper.StringHelper; import com.github.javaparser.ast.comments.Comment; import com.github.javaparser.javadoc.Javadoc; import lombok.Getter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/schema/Project.java b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Project.java similarity index 95% rename from apidoc-core/src/main/java/kim/apidoc/core/schema/Project.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/schema/Project.java index 6cbf3fb7f5a8250974b0e262a28ff41ca0c383b5..656ce2bac78261abcde67ab76ad13bf421011697 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/schema/Project.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Project.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.schema; +package com.kim.apidoc.core.schema; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/schema/Row.java b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Row.java similarity index 94% rename from apidoc-core/src/main/java/kim/apidoc/core/schema/Row.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/schema/Row.java index b3ea98bfe17cd1c12215e187b74a334923d1b9f2..ed47a68ac560dc08d03eeae109f420fba6011548 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/schema/Row.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Row.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.schema; +package com.kim.apidoc.core.schema; import lombok.*; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/schema/Section.java b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Section.java similarity index 95% rename from apidoc-core/src/main/java/kim/apidoc/core/schema/Section.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/schema/Section.java index 7dcff547dde9e8431be1b9de49a9a9f1041d2e29..7cd8918c41ed0eb57d2df642fc49b5180981ce0d 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/schema/Section.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Section.java @@ -1,8 +1,8 @@ -package kim.apidoc.core.schema; +package com.kim.apidoc.core.schema; -import kim.apidoc.core.common.ObjectMappers; -import kim.apidoc.core.common.QueryStringBuilder; -import kim.apidoc.core.common.helper.StringHelper; +import com.kim.apidoc.core.common.ObjectMappers; +import com.kim.apidoc.core.common.QueryStringBuilder; +import com.kim.apidoc.core.common.helper.StringHelper; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.Getter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/schema/Tag.java b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Tag.java similarity index 95% rename from apidoc-core/src/main/java/kim/apidoc/core/schema/Tag.java rename to apidoc-core/src/main/java/com/kim/apidoc/core/schema/Tag.java index 753ae7c5ddd74cc1baefe8b2441447d861102043..899ed6247901b02313239669503977b703a2698f 100644 --- a/apidoc-core/src/main/java/kim/apidoc/core/schema/Tag.java +++ b/apidoc-core/src/main/java/com/kim/apidoc/core/schema/Tag.java @@ -1,4 +1,4 @@ -package kim.apidoc.core.schema; +package com.kim.apidoc.core.schema; import lombok.Getter; import lombok.Setter; diff --git a/apidoc-core/src/main/java/kim/apidoc/core/render/MarkdownRender.java b/apidoc-core/src/main/java/kim/apidoc/core/render/MarkdownRender.java deleted file mode 100644 index 739d24a8a39856f65f8ac726d8d0dbdbd2e8b4b1..0000000000000000000000000000000000000000 --- a/apidoc-core/src/main/java/kim/apidoc/core/render/MarkdownRender.java +++ /dev/null @@ -1,18 +0,0 @@ -package kim.apidoc.core.render; - -import kim.apidoc.core.schema.Project; - -/** - * 生成markdown api文档 - * - * @author duanledexianxianxian - * @version 1.0.0 - * @date 2020 /3/26 19:03 - * @since 1.0.0 - */ -public class MarkdownRender implements ProjectRender { - @Override - public void render(Project project) { - - } -} diff --git a/apidoc-core/src/main/resources/templates/markdown.ftl b/apidoc-core/src/main/resources/templates/markdown.ftl new file mode 100644 index 0000000000000000000000000000000000000000..0da6d537c31bb46470c928db18937a1079520642 --- /dev/null +++ b/apidoc-core/src/main/resources/templates/markdown.ftl @@ -0,0 +1,83 @@ +[TOC] + + + + +<#-- ---------- BEGIN 循环遍历book ----------> +<#if books??> + <#list books as bookKey,bookValue> + ${bookKey} + <#if bookValue.name??> +# ${bookValue.name} + + + <#list bookValue.chapters> + <#items as chapter> +## ${chapter?counter}. ${chapter.name} + +${chapter.description} + + <#list chapter.sections> + <#items as section> + ### ${chapter?counter}.${section?counter} ${section.name} + + ${section.description} + + **request** + + ```HTTP + POST /api/v1/users HTTP/1.1 + + { + "loginId":"admin", + "userName":"123456", + "passwords":"123456" + } + ``` + + **header** + + | Field | Type | Condition | Default | Description | + | :------- | :----- | :-------- | :------ | :---------- | + | loginId | String | | | 用户编号 | + | userName | String | | | 用户名 | + | password | String | | | 密码 | + + **query** + + | Field | Type | Condition | Default | Description | + | :------- | :----- | :-------- | :------ | :---------- | + <#list section.requestRows as rowKey,rowValue> + | rowValue.key | rowValue.type | rowValue.condition | rowValue.def | rowValue.remark | + + + **body** + + | Field | Type | Condition | Default | Description | + | :------- | :----- | :-------- | :------ | :---------- | + | loginId | String | | | 用户编号 | + | userName | String | | | 用户名 | + | password | String | | | 密码 | + + **response** + + ``` + { + "loginId":"admin", + "userName":"123456", + "passwords":"123456" + } + ``` + + | Field | Type | Description | + | :------- | :----- | :---------- | + | loginId | String | 用户编号 | + | userName | String | 用户名 | + | password | String | 密码 | + + + + + + +<#------------ END 循环遍历book ----------> diff --git a/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/RequestMappingHelper.java b/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/RequestMappingHelper.java index ba0aa40a336ab2eef65e8658e28f674ecf5ab71b..e1624c3f3b7b21f60385522f5172e17db99a595a 100644 --- a/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/RequestMappingHelper.java +++ b/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/RequestMappingHelper.java @@ -1,10 +1,10 @@ package com.kim.apidoc.springmvc; -import kim.apidoc.core.common.URI; -import kim.apidoc.core.common.helper.AnnotationHelper; -import kim.apidoc.core.common.helper.ClassDeclarationHelper; -import kim.apidoc.core.common.helper.ExpressionHelper; -import kim.apidoc.core.schema.Method; +import com.kim.apidoc.core.common.URI; +import com.kim.apidoc.core.common.helper.AnnotationHelper; +import com.kim.apidoc.core.common.helper.ClassDeclarationHelper; +import com.kim.apidoc.core.common.helper.ExpressionHelper; +import com.kim.apidoc.core.schema.Method; import com.github.javaparser.ast.Node; import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; diff --git a/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/SpringMVCContext.java b/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/SpringMVCContext.java index e178cdb453b991b30c9308314bcf2cbf8447ae2b..53b65a9de081a34f2b38ca9aec499fe483f03a93 100644 --- a/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/SpringMVCContext.java +++ b/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/SpringMVCContext.java @@ -1,6 +1,6 @@ package com.kim.apidoc.springmvc; -import kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.ApiDoc; import com.google.common.collect.Lists; import lombok.Data; diff --git a/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/SpringParser.java b/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/SpringParser.java index 091a26fd2eb4a7574bf0e4a5466bc6d5d3c1fb7b..58a7e1aa30897159b7bf8ee0de0f407544e7419b 100644 --- a/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/SpringParser.java +++ b/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/SpringParser.java @@ -1,18 +1,18 @@ package com.kim.apidoc.springmvc; import com.kim.apidoc.springmvc.resovler.SpringComponentTypeResolver; -import kim.apidoc.core.ApiDoc; -import kim.apidoc.core.common.URI; -import kim.apidoc.core.common.description.ObjectTypeDescription; -import kim.apidoc.core.common.description.TypeDescription; -import kim.apidoc.core.common.helper.AnnotationHelper; -import kim.apidoc.core.common.helper.ExpressionHelper; -import kim.apidoc.core.common.helper.StringHelper; -import kim.apidoc.core.parser.ParserStrategy; -import kim.apidoc.core.schema.Chapter; -import kim.apidoc.core.schema.Header; -import kim.apidoc.core.schema.Row; -import kim.apidoc.core.schema.Section; +import com.kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.common.URI; +import com.kim.apidoc.core.common.description.ObjectTypeDescription; +import com.kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.helper.AnnotationHelper; +import com.kim.apidoc.core.common.helper.ExpressionHelper; +import com.kim.apidoc.core.common.helper.StringHelper; +import com.kim.apidoc.core.parser.ParserStrategy; +import com.kim.apidoc.core.schema.Chapter; +import com.kim.apidoc.core.schema.Header; +import com.kim.apidoc.core.schema.Row; +import com.kim.apidoc.core.schema.Section; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.body.Parameter; diff --git a/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/resovler/SpringComponentTypeResolver.java b/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/resovler/SpringComponentTypeResolver.java index 7132860bc645ff94806be480a004bbf392464e07..62780943ca1dec72f5e89d4e0ac6458c84f1573f 100644 --- a/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/resovler/SpringComponentTypeResolver.java +++ b/apidoc-springmvc/src/main/java/com/kim/apidoc/springmvc/resovler/SpringComponentTypeResolver.java @@ -1,11 +1,11 @@ package com.kim.apidoc.springmvc.resovler; -import kim.apidoc.core.ApiDoc; -import kim.apidoc.core.common.description.TypeDescription; -import kim.apidoc.core.common.description.UnAvailableTypeDescription; -import kim.apidoc.core.common.helper.TypeParameterHelper; -import kim.apidoc.core.resolver.TypeNameResolver; -import kim.apidoc.core.resolver.TypeResolver; +import com.kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.common.description.TypeDescription; +import com.kim.apidoc.core.common.description.UnAvailableTypeDescription; +import com.kim.apidoc.core.common.helper.TypeParameterHelper; +import com.kim.apidoc.core.resolver.TypeNameResolver; +import com.kim.apidoc.core.resolver.TypeResolver; import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.type.Type; import com.github.javaparser.resolution.types.ResolvedType; diff --git a/apidoc-springmvc/src/main/resources/META-INF/services/kim.apidoc.core.parser.ParserStrategy b/apidoc-springmvc/src/main/resources/META-INF/services/com.kim.apidoc.core.parser.ParserStrategy similarity index 100% rename from apidoc-springmvc/src/main/resources/META-INF/services/kim.apidoc.core.parser.ParserStrategy rename to apidoc-springmvc/src/main/resources/META-INF/services/com.kim.apidoc.core.parser.ParserStrategy diff --git a/apidoc-springmvc/src/test/java/com/kim/apidoc/example/ApigccTest.java b/apidoc-springmvc/src/test/java/com/kim/apidoc/example/ApigccTest.java index 7684aa0f6485515c3fe9a23f20c090b866351b87..f9046ea1193519308284904f351ecc97b422e795 100644 --- a/apidoc-springmvc/src/test/java/com/kim/apidoc/example/ApigccTest.java +++ b/apidoc-springmvc/src/test/java/com/kim/apidoc/example/ApigccTest.java @@ -1,8 +1,8 @@ package com.kim.apidoc.example; -import kim.apidoc.core.ApiDoc; -import kim.apidoc.core.Context; +import com.kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.Context; import org.junit.Test; import java.nio.file.Paths; diff --git a/apidoc-springmvc/src/test/java/com/kim/apidoc/springmvc/SpringTest.java b/apidoc-springmvc/src/test/java/com/kim/apidoc/springmvc/SpringTest.java index f372c1d32b2d5cca2c2c115190ce45eb8e7aed5a..23b6e0d983d6a4de9e38c0b0e3ec12366c68f807 100644 --- a/apidoc-springmvc/src/test/java/com/kim/apidoc/springmvc/SpringTest.java +++ b/apidoc-springmvc/src/test/java/com/kim/apidoc/springmvc/SpringTest.java @@ -1,8 +1,8 @@ package com.kim.apidoc.springmvc; -import kim.apidoc.core.ApiDoc; -import kim.apidoc.core.Context; -import kim.apidoc.core.common.diff.FileMatcher; +import com.kim.apidoc.core.ApiDoc; +import com.kim.apidoc.core.Context; +import com.kim.apidoc.core.common.diff.FileMatcher; import org.junit.Test; import java.io.IOException; diff --git "a/markdown\346\216\245\345\217\243\346\250\241\347\211\210.md" "b/markdown\346\216\245\345\217\243\346\250\241\347\211\210.md" index a596775fc9361d929f551a187e95e6766de47c49..6bc9502473a2fb6123b9e7bdc265a8739cf4202c 100644 --- "a/markdown\346\216\245\345\217\243\346\250\241\347\211\210.md" +++ "b/markdown\346\216\245\345\217\243\346\250\241\347\211\210.md" @@ -2,6 +2,10 @@ + + +# 系统管理 + ## 1. 用户接口 与用户相关接口。 @@ -10,7 +14,7 @@ 添加用户 -#### request + **request** ```HTTP POST /api/v1/users HTTP/1.1 @@ -22,7 +26,7 @@ POST /api/v1/users HTTP/1.1 } ``` -##### header + **header** | Field | Type | Condition | Default | Description | | :------- | :----- | :-------- | :------ | :---------- | @@ -30,7 +34,7 @@ POST /api/v1/users HTTP/1.1 | userName | String | | | 用户名 | | password | String | | | 密码 | -##### query + **query** | Field | Type | Condition | Default | Description | | :------- | :----- | :-------- | :------ | :---------- | @@ -38,7 +42,7 @@ POST /api/v1/users HTTP/1.1 | userName | String | | | 用户名 | | password | String | | | 密码 | -##### body + **body** | Field | Type | Condition | Default | Description | | :------- | :----- | :-------- | :------ | :---------- | @@ -46,7 +50,7 @@ POST /api/v1/users HTTP/1.1 | userName | String | | | 用户名 | | password | String | | | 密码 | -#### response + **response** ``` {