当前位置:网站首页>Learn to use code to generate beautiful interface documents!!!
Learn to use code to generate beautiful interface documents!!!
2022-07-07 00:43:00 【Gettler•Main】
Write beautiful interface documents
Controller layer : export Swagger file
Click here
As shown in the figure below
ctrl + a
, ctrl + c
Open after copying all DocWay
Click Add , Import
Select import Swagger, Click Paste Swagger Content , Paste in a lot of data just copied , Click Import
Open the new project
Select export project in the more functions in the upper right corner to export offline interface documents
Very beautiful
Service layer : Use Idea Generate JavaDoc
open idea, Generate... Here JavaDoc
-encoding UTF-8 -charset UTF-8
Click generate
open index.html, The documents are as follows
database :Screw
Add dependency
<!-- screw Screw core -->
<dependency>
<groupId>cn.smallbun.screw</groupId>
<artifactId>screw-core</artifactId>
<version>1.0.3</version>
</dependency>
<!-- HikariCP Database connection pool -->
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.4.5</version>
</dependency>
Writing test classes
package com.gettler.oa_team05.DataBaseOutput;
import cn.smallbun.screw.core.Configuration;
import cn.smallbun.screw.core.engine.EngineConfig;
import cn.smallbun.screw.core.engine.EngineFileType;
import cn.smallbun.screw.core.engine.EngineTemplateType;
import cn.smallbun.screw.core.execute.DocumentationExecute;
import cn.smallbun.screw.core.process.ProcessConfig;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.junit.Test;
import java.util.ArrayList;
public class DataSourceOutDemo {
@Test
public void test() {
// DataSource dataSourceMysql = SpringContextUtil.getBean(DataSource.class);
HikariConfig hikariConfig = new HikariConfig();
hikariConfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
hikariConfig.setJdbcUrl("jdbc:mysql://localhost:3306/oa_team05?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8");
hikariConfig.setUsername("root");
hikariConfig.setPassword("73748156");
HikariDataSource dataSourceMysql = new HikariDataSource(hikariConfig);
// Generate file configuration
EngineConfig engineConfig = EngineConfig.builder()
// Generate file path
.fileOutputDir("D:/")
// Open Directory
.openOutputDir(true)
// file type
.fileType(EngineFileType.HTML)
// Generate template implementation
.produceType(EngineTemplateType.freemarker).build();
// Generate document configuration ( Include the following custom version number 、 Description, etc )
Configuration config = Configuration.builder().version("V1").description(" Database documents ").dataSource(dataSourceMysql).engineConfig(engineConfig).produceConfig(getProcessConfig()).build();
// Perform build
new DocumentationExecute(config).execute();
}
/** * Configure the table you want to generate + Configure the tables you want to ignore * * @return Build table configuration */
public static ProcessConfig getProcessConfig() {
// // Ignore table name
// List<String> ignoreTableName = Arrays.asList("dept", "dept1");
// // Ignore table prefix , If you ignore a The first database table
// List<String> ignorePrefix = Arrays.asList("dept", "dept1");
// // Ignore table suffix
// List<String> ignoreSuffix = Arrays.asList("dept", "dept1");
return ProcessConfig.builder()
// Specify a table by name to generate
// .designatedTableName(Arrays.asList("tb_his_prescription_record_extend", "tb_his_prescription_detail_extend"))
// Generate according to the table prefix
.designatedTablePrefix(new ArrayList<>())
// Generate from table suffix
.designatedTableSuffix(new ArrayList<>()).build();
// Ignore table name
// .ignoreTableName(ignoreTableName)
// Ignore table prefix
// .ignoreTablePrefix(ignorePrefix)
// Ignore table suffix
// .ignoreTableSuffix(ignoreSuffix).build();
}
}
Run to generate documents
边栏推荐
- dynamic programming
- Leecode brush questions record sword finger offer 44 A digit in a sequence of numbers
- Are you ready to automate continuous deployment in ci/cd?
- 2022/2/12 summary
- 一图看懂对程序员的误解:西方程序员眼中的中国程序员
- Data analysis course notes (III) array shape and calculation, numpy storage / reading data, indexing, slicing and splicing
- 如何判断一个数组中的元素包含一个对象的所有属性值
- 基於GO語言實現的X.509證書
- Cross-entrpy Method
- 2022 PMP project management examination agile knowledge points (9)
猜你喜欢
三维扫描体数据的VTK体绘制程序设计
48页数字政府智慧政务一网通办解决方案
Basic information of mujoco
2022 PMP project management examination agile knowledge points (9)
Interface master v3.9, API low code development tool, build your interface service platform immediately
2022/2/11 summary
Data analysis course notes (V) common statistical methods, data and spelling, index and composite index
Five different code similarity detection and the development trend of code similarity detection
stm32F407-------SPI通信
2021 SASE integration strategic roadmap (I)
随机推荐
Huawei mate8 battery price_ Huawei mate8 charges very slowly after replacing the battery
Leecode brushes questions to record interview questions 17.16 massagist
AI超清修复出黄家驹眼里的光、LeCun大佬《深度学习》课程生还报告、绝美画作只需一行代码、AI最新论文 | ShowMeAI资讯日报 #07.06
Advanced learning of MySQL -- basics -- multi table query -- self join
Liuyongxin report | microbiome data analysis and science communication (7:30 p.m.)
2021 SASE integration strategic roadmap (I)
Use mujoco to simulate Cassie robot
学习光线跟踪一样的自3D表征Ego3RT
AI super clear repair resurfaces the light in Huang Jiaju's eyes, Lecun boss's "deep learning" course survival report, beautiful paintings only need one line of code, AI's latest paper | showmeai info
Quaternion attitude calculation of madgwick
Common shortcuts to idea
Mujoco second order simple pendulum modeling and control
48页数字政府智慧政务一网通办解决方案
Personal digestion of DDD
如何判断一个数组中的元素包含一个对象的所有属性值
Leecode brush question record sword finger offer 58 - ii Rotate string left
What can the interactive slide screen demonstration bring to the enterprise exhibition hall
Notes of training courses selected by Massey school
Three sentences to briefly introduce subnet mask
equals()与hashCode()