Commit 14f303d4 authored by duanledexianxianxian's avatar duanledexianxianxian 😁

生成markdown api文档

parent bf2a7907
......@@ -32,7 +32,7 @@ public class Project extends Node {
*/
List<Appendix> appendices = new LinkedList<>();
/**
* resultData
* 统一结果
*/
ClassOrInterfaceDeclaration resultDataClassOrInterfaceDeclaration;
......
......@@ -308,11 +308,13 @@ public class SpringParser implements ParserStrategy {
* @param section the section
*/
private void visitReturn(MethodDeclaration n, Chapter chapter, Section section) {
ClassOrInterfaceType returnType = new ClassOrInterfaceType();
returnType.setName(ApiDoc.getInstance().getProject().getResultDataClassOrInterfaceDeclaration().getName());
returnType.setTypeArguments(n.getType());
n.setType(returnType);
ClassOrInterfaceDeclaration resultDataClassOrInterfaceDeclaration = ApiDoc.getInstance().getProject().getResultDataClassOrInterfaceDeclaration();
if (null != resultDataClassOrInterfaceDeclaration) {
ClassOrInterfaceType returnType = new ClassOrInterfaceType();
returnType.setName(resultDataClassOrInterfaceDeclaration.getName());
returnType.setTypeArguments(n.getType());
n.setType(returnType);
}
TypeDescription description = ApiDoc.getInstance().getTypeResolvers().resolve(n.getType());
if (description.isAvailable()) {
if (description.isPrimitive()) {
......
......@@ -41,6 +41,7 @@ public class KimUserController {
* Add integer.
*
* @return the integer
* @return
*/
@PostMapping
public Integer add() {
......
......@@ -17,7 +17,7 @@ public class SpringTest {
Context context = new Context();
context.setId("test");
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");
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