Commit 14f303d4 authored by duanledexianxianxian's avatar duanledexianxianxian 😁

生成markdown api文档

parent bf2a7907
...@@ -32,7 +32,7 @@ public class Project extends Node { ...@@ -32,7 +32,7 @@ public class Project extends Node {
*/ */
List<Appendix> appendices = new LinkedList<>(); List<Appendix> appendices = new LinkedList<>();
/** /**
* resultData * 统一结果
*/ */
ClassOrInterfaceDeclaration resultDataClassOrInterfaceDeclaration; ClassOrInterfaceDeclaration resultDataClassOrInterfaceDeclaration;
......
...@@ -308,11 +308,13 @@ public class SpringParser implements ParserStrategy { ...@@ -308,11 +308,13 @@ public class SpringParser implements ParserStrategy {
* @param section the section * @param section the section
*/ */
private void visitReturn(MethodDeclaration n, Chapter chapter, Section section) { private void visitReturn(MethodDeclaration n, Chapter chapter, Section section) {
ClassOrInterfaceDeclaration resultDataClassOrInterfaceDeclaration = ApiDoc.getInstance().getProject().getResultDataClassOrInterfaceDeclaration();
if (null != resultDataClassOrInterfaceDeclaration) {
ClassOrInterfaceType returnType = new ClassOrInterfaceType(); ClassOrInterfaceType returnType = new ClassOrInterfaceType();
returnType.setName(ApiDoc.getInstance().getProject().getResultDataClassOrInterfaceDeclaration().getName()); returnType.setName(resultDataClassOrInterfaceDeclaration.getName());
returnType.setTypeArguments(n.getType()); returnType.setTypeArguments(n.getType());
n.setType(returnType); n.setType(returnType);
}
TypeDescription description = ApiDoc.getInstance().getTypeResolvers().resolve(n.getType()); TypeDescription description = ApiDoc.getInstance().getTypeResolvers().resolve(n.getType());
if (description.isAvailable()) { if (description.isAvailable()) {
if (description.isPrimitive()) { if (description.isPrimitive()) {
......
...@@ -41,6 +41,7 @@ public class KimUserController { ...@@ -41,6 +41,7 @@ public class KimUserController {
* Add integer. * Add integer.
* *
* @return the integer * @return the integer
* @return
*/ */
@PostMapping @PostMapping
public Integer add() { public Integer add() {
......
...@@ -17,7 +17,7 @@ public class SpringTest { ...@@ -17,7 +17,7 @@ public class SpringTest {
Context context = new Context(); Context context = new Context();
context.setId("test"); context.setId("test");
context.setName("测试项目"); context.setName("测试项目");
context.addSource(Paths.get("K:\\@project-dianli@\\tool\\apidoc\\apidoc-springmvc\\src\\test\\java")); context.addSource(Paths.get("F:\\@project@\\@dianli@\\tool\\apidoc\\apidoc-springmvc\\src\\test\\java"));
// context.setCss("https://darshandsoni.com/asciidoctor-skins/css/monospace.css"); // context.setCss("https://darshandsoni.com/asciidoctor-skins/css/monospace.css");
ApiDoc apigcc = new ApiDoc(context); ApiDoc apigcc = new ApiDoc(context);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment