best2018
								2023-07-14 10:50:13
							
							
								原证
							springboot集成smart-doc插件,一键生成代码接口API文档
项目描述
springboot集成smart-doc插件,一键生成html、markdown、adoc等多种文件类型的代码API接口文档。
对现有项目代码无侵入,支持javadoc,随时可以生成最新的代码文档,简单好用!
运行环境
jdk8,17+IntelliJ IDEA+maven
项目技术(必填)
springboot+smart-doc插件
数据库文件(可选)
无
依赖包文件(可选)
无
资源包文件(可选)
无
运行视频(可选)
无
是否原创(转载必填原文地址)
原创
项目截图(必填)
运行截图(必填)
简单三步生成现有代码API接口文档
1)pom中配置smart-doc插件配置,详见项目pom文档
2)resources目录下新建smart-doc.json文件,配置生成文档输出地址
3)打开IDEA maven视图,选择smart-doc插件,右键执行即可生成相关API接口文档
curl -X GET -i http://localhost:8080/hello/nono/zuidaima
注意事项(可选)
1. 本地如果没有java 17,需要修改spring-boot-starter-parent的版本
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.14</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
2.需要添加serverUrl参数,修改smart-doc.json配置文件即可
{
  "serverUrl": "http://localhost:8080",
  "outPath": "D://smart-doc"
}
其他配置项请参考https://smart-doc-group.github.io/#/zh-cn/diy/config
3.HelloController.java代码有问题,修改为如下:
package com.simon.springbootsmartdoc.controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * @author simon
 */
@RestController
@RequestMapping("/hello")
public class HelloController {
    @RequestMapping("/nono/{nono}")
    public String nono(@PathVariable(name = "nono") String nono) {
        return "Hello " + nono + "!";
    }
    @RequestMapping("/index")
    public String index() {
        return "Hello World!";
    }
}
							猜你喜欢
- java自动生成数据库文档
- java导出word之FreeMarker生成word文档
- java生成一个复杂的Excel,图形,数据,格式的排版,右键直接运行
- Spring MVC+swagger作为restful api的doc在线文档生成
- SpringBoot Freemarker定制word文档下载,支持文档内图文导出
- SpringBoot集成OpenOffice实现Office文档在线预览
- bootstrap教程html文档版,附一个基于bootstrap的后台管理系统
- SpringBoot2.0根据word模板导出word文件
- word文档在线网页预览系统,类似于百度文库
- java通过Aspose.Word控件实现Word文档的操作
- java通过jacob插件把图片插入word文档并且打印
- jsp利用JXL包实现excel表的输出
请下载代码后再发表评论
    
											  
													 文件名:springboot-smartdoc.zip,文件大小:65.755K
											  
											  
												  下载
											  
											  
											  
												
										  
								- /- /springboot-smartdoc- /springboot-smartdoc/.idea- /springboot-smartdoc/.idea/.gitignore
- /springboot-smartdoc/.idea/compiler.xml
- /springboot-smartdoc/.idea/encodings.xml
- /springboot-smartdoc/.idea/jarRepositories.xml
- /springboot-smartdoc/.idea/misc.xml
- /springboot-smartdoc/.idea/workspace.xml
 
- /springboot-smartdoc/.mvn- /springboot-smartdoc/.mvn/wrapper
 
- /springboot-smartdoc/.mvn/wrapper
- /springboot-smartdoc/src- /springboot-smartdoc/src/main- /springboot-smartdoc/src/main/java- /springboot-smartdoc/src/main/java/com- /springboot-smartdoc/src/main/java/com/simon- /springboot-smartdoc/src/main/java/com/simon/springbootsmartdoc- /springboot-smartdoc/src/main/java/com/simon/springbootsmartdoc/SpringbootSmartdocApplication.java
- /springboot-smartdoc/src/main/java/com/simon/springbootsmartdoc/controller
 
 
- /springboot-smartdoc/src/main/java/com/simon/springbootsmartdoc
 
- /springboot-smartdoc/src/main/java/com/simon
 
- /springboot-smartdoc/src/main/java/com
 
- /springboot-smartdoc/src/main/java
- /springboot-smartdoc/src/test- /springboot-smartdoc/src/test/java- /springboot-smartdoc/src/test/java/com- /springboot-smartdoc/src/test/java/com/simon- /springboot-smartdoc/src/test/java/com/simon/springbootsmartdoc
 
 
- /springboot-smartdoc/src/test/java/com/simon
 
- /springboot-smartdoc/src/test/java/com
 
- /springboot-smartdoc/src/test/java
 
- /springboot-smartdoc/src/main
 
- /springboot-smartdoc/.idea
 
- /springboot-smartdoc
 相关代码
相关代码
				- 证 Spring Boot创建自定义Banner.txt实例
- 证 Spring Boot Actuator 2.3.4.RELEASE新版本实现自定义端点信息的配置实例
- 证 Spring Boot整合Ehcache的简单入门实例
- 证 Spring Boot整合VueJS+spring data jpa实现待办事项TODO项目实例
- 证 Springboot+thymeleaf对员工的增删改查操作 带分页功能
- 证 Spring Boot整合Freemarker实现文件上传项目实例
- 证 Spring Boot配置@Profile注解加载不同环境的配置文件实例
- 证 spring boot使用不指定Maven parent pom来创建可执行的spring boot项目
- 证 Spring Boot整合SpringFox Swagger2实现REST API增删改查项目实例
- 原证 springboot+sqlite3+iceEditor开发网页版记事本
- 原证 spring AOP 过滤器 拦截器 执行顺序示例
- 证 基于Spring Boot、Layui和Mybatis-plus的后台管理系统脚手架项目
 最近下载
最近下载
				
                cheung524071     LV8
                2023年8月23日
            
            
        
                最代码官方     LV168
                2023年8月13日
            
            
         最近浏览
最近浏览
				
                docnnxxy688    
                3月22日
            
            
                    暂无贡献等级
            
        
                srmess     LV4
                2024年12月30日
            
            
        
                lxy135     LV1
                2023年10月10日
            
            
        
                夜起星河     LV8
                2023年9月28日
            
            
        
                szf123     LV12
                2023年9月23日
            
            
        
                茶茶茶百道qq    
                2023年9月20日
            
            
                    暂无贡献等级
            
        
                zhy1989wz     LV7
                2023年9月11日
            
            
        
                Sean_admin     LV7
                2023年9月5日
            
            
        
                微信网友_6461019441418240     LV2
                2023年9月4日
            
            
        
                zhuiqiu     LV4
                2023年9月2日
            
            
        





 
                 
                 
                 
    