当前位置:网站首页>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
边栏推荐
- 37页数字乡村振兴智慧农业整体规划建设方案
- 深度学习之线性代数
- uniapp实现从本地上传头像并显示,同时将头像转化为base64格式存储在mysql数据库中
- Advanced learning of MySQL -- Fundamentals -- four characteristics of transactions
- build. How to configure the dependent version number in the gradle file
- Advanced learning of MySQL -- basics -- basic operation of transactions
- 2022/2/12 summary
- Leecode brush questions record sword finger offer 43 The number of occurrences of 1 in integers 1 to n
- js导入excel&导出excel
- "Latex" Introduction to latex mathematical formula "suggestions collection"
猜你喜欢
Jenkins' user credentials plug-in installation
Slam d'attention: un slam visuel monoculaire appris de l'attention humaine
基于GO语言实现的X.509证书
Idea automatically imports and deletes package settings
Clipboard management tool paste Chinese version
The programmer resigned and was sentenced to 10 months for deleting the code. Jingdong came home and said that it took 30000 to restore the database. Netizen: This is really a revenge
48 page digital government smart government all in one solution
37页数字乡村振兴智慧农业整体规划建设方案
Geo data mining (III) enrichment analysis of go and KEGG using David database
How to set encoding in idea
随机推荐
Amazon MemoryDB for Redis 和 Amazon ElastiCache for Redis 的内存优化
Imeta | Chen Chengjie / Xia Rui of South China Agricultural University released a simple method of constructing Circos map by tbtools
基于SSM框架的文章管理系统
alexnet实验偶遇:loss nan, train acc 0.100, test acc 0.100情况
Leecode brushes questions to record interview questions 17.16 massagist
Understand the misunderstanding of programmers: Chinese programmers in the eyes of Western programmers
threejs图片变形放大全屏动画js特效
Linear algebra of deep learning
Three application characteristics of immersive projection in offline display
【YoloV5 6.0|6.1 部署 TensorRT到torchserve】环境搭建|模型转换|engine模型部署(详细的packet文件编写方法)
C language input / output stream and file operation [II]
Quaternion attitude calculation of madgwick
Win10 startup error, press F9 to enter how to repair?
Sword finger offer 26 Substructure of tree
Business process testing based on functional testing
Service asynchronous communication
【软件逆向-自动化】逆向工具大全
Why should a complete knapsack be traversed in sequence? Briefly explain
Clipboard management tool paste Chinese version
If the college entrance examination goes well, I'm already graying out at the construction site at the moment