2021-03-31

官方文档地址:https://gitee.com/smart-doc-team/smart-doc/wikis/pages?sort_id=3695028&doc_id=411715
0、下载tornahttps://gitee.com/durcframework/torna/releases
1、添加如下插件依赖:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
        <groupId>com.github.shalousun</groupId>
        <artifactId>smart-doc-maven-plugin</artifactId>
            <version>2.1.1</version>

            <configuration>
            <!--指定生成文档的使用的配置文件,配置文件放在自己的项目中-->
            <configFile>./src/main/resources/smart-doc.json</configFile>
            <!--指定项目名称-->
            <projectName>测试</projectName>
            <!--smart-doc实现自动分析依赖树加载第三方依赖的源码,如果一些框架依赖库加载不到导致报错,这时请使用excludes排除掉-->
            <excludes>
                <!--格式为:groupId:artifactId;参考如下-->
                <!--1.0.7版本开始你还可以用正则匹配排除,如:poi.* -->
                <exclude>com.alibaba:fastjson</exclude>
            </excludes>
            <!--自1.0.8版本开始,插件提供includes支持-->
            <!--smart-doc能自动分析依赖树加载所有依赖源码,原则上会影响文档构建效率,因此你可以使用includes来让插件加载你配置的组件-->
            <includes>
                <!--格式为:groupId:artifactId;参考如下-->
                <include>com.alibaba:fastjson</include>
            </includes>
        </configuration>
        <executions>
            <execution>
                <!--如果不需要在执行编译时启动smart-doc,则将phase注释掉-->
                <phase>compile</phase>
                <goals>
                    <!--smart-doc提供了html、openapi、markdown等goal,可按需配置-->
                    <goal>html</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    </plugins>
</build>

2、添加如下配置文件:smart-doc.json  在resources目录下

{
  "serverUrl": "http://127.0.0.1", //服务器地址,非必须。导出postman建议设置成http://{{server}}方便直接在postman直接设置环境变量
  "isStrict": false, //是否开启严格模式
  "packageFilters": "",//controller包过滤,多个包用英文逗号隔开
  "projectName": "smart-doc",//配置自己的项目名称
  "appKey": "20201216788835306945118208",// torna平台对接appKey,, @since 2.0.9
  "appToken": "c16931fa6590483fb7a4e85340fcbfef", //torna平台appToken,@since 2.0.9
  "secret": "W.ZyGMOB9Q0UqujVxnfi@.I#V&tUUYZR",//torna平台secret,@since 2.0.9
  "openUrl": "http://localhost:7700/api",//torna平台地址,填写自己的私有化部署地址@since 2.0.9
  "debugEnvName":"测试环境", //torna测试环境
  "debugEnvUrl":"http://127.0.0.1",//torna
}

3、生成文档:

 

4、访问:http://localhost:7700/#/dashboard

5、访问上面网址前需要开启torna 服务下载地址见步骤0

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值