当前位置:网站首页>Smart doc + Torna generate interface document

Smart doc + Torna generate interface document

2022-04-23 16:48:00 A coir boat in the broken white clouds

One 、 Integrate pom plug-in unit

<!-- smart-doc + torna Generate interface document -->
            <plugin>
                <groupId>com.github.shalousun</groupId>
                <artifactId>smart-doc-maven-plugin</artifactId>
                <version>2.3.0</version>
                <configuration>
                    <!-- Specifies the profile used to generate the document , The configuration file is placed in your own project -->
                    <configFile>./src/main/resources/smart-doc.json</configFile>
                    <!-- Specify project name -->
                    <projectName> Project name </projectName>
                    <!--smart-doc Automatically analyze the dependency tree and load the source code of third-party dependencies , If some framework dependent libraries cannot be loaded, an error will be reported , Please use excludes Get rid of -->
                    <excludes>
                        <!-- The format is :groupId:artifactId; Refer to the following -->
                        <exclude>com.alibaba:fastjson</exclude>
                    </excludes>
                    <!-- since 1.0.8 Version start , Plug in provides includes Support , Configured with includes The plug-in will be loaded according to the user configuration instead of automatically , Therefore, attention should be paid to -->
                    <!--smart-doc Dependency tree can be loaded automatically , In principle, it will affect the efficiency of document construction , So you can use includes To let the plug-in load your configured components -->
                    <includes>
                        <!-- The format is :groupId:artifactId; Refer to the following -->
                        <include>com.alibaba:fastjson</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <!-- If you don't need to start at compile time smart-doc, Will phase Comment out -->
                        <phase>compile</phase>
                        <goals>
                            <!--smart-doc Provides html、openapi、markdown etc. goal, It can be configured as required -->
                            <goal>html</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Two 、 newly build json file ==》 ./src/main/resources/smart-doc.json

{
  "serverUrl": "http://---------:8080/product",
  "outPath": "C:\\Users\\11827\\Desktop\\doc\\smart-doc",
  "isStrict": false,
  "coverOld": true,
  "showAuthor": true,
  "inlineEnum":true,
  "packageFilters": "com.xycm.mall.product.controller",
  "projectName": " goods ",
  "appKey": "a---------------",
  "appToken": "a---------------",
  "secret": "a---------------",
  "debugEnvName":" development environment ",
  "debugEnvUrl":"http://---------:8080/product",
  "openUrl": "http://---------:7777/api",
  "author": " Big brother "
}

3、 ... and 、 maven Click upload
 Insert picture description here
success , Milk thought ~

版权声明
本文为[A coir boat in the broken white clouds]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231400068459.html