Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is spring-boot-plus?

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what is spring-boot-plus". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what is spring-boot-plus?"

Spring-boot-plus is a rapid background development framework that integrates common development components of spring boot.

Spring-Boot-Plus is easy to use, fast, efficient, feature-rich, open source spring boot scaffolding.

> the front and rear ends are separated and focus on the back-end services

target

> everyone can develop projects independently, quickly and efficiently!

Version library GITHUB | main features of GITEE official website springboot.plus

Integrate spring boot common development component set, common configuration, AOP log, etc.

Integrated mybatis plus fast dao operation

Quickly generate background code: entity/param/vo/controller/service/mapper/xml

Integrate swagger2 to generate api documents automatically

Integrated access control of jwt and shiro/spring security

Integrate redis, spring cache, ehcache cach

Integrated rabbit/rocket/kafka mq message queuing

Integrated druid connection pooling, JDBC performance and slow query detection

Integrate spring boot admin to detect the operation of the project in real time

Use the assembly maven plug-in to package and deploy different environments, including startup and restart commands, and extract configuration files to an external config directory

Project architecture

Project environment middleware version remarks JDK1.8+JDK1.8 and above MySQL5.7+5.7 and above Redis3.2+

Technical selection technical version remarks Spring Boot2.2.0.RELEASE latest release stable version Spring Framework5.2.0.RELEASE latest release stable version Mybatis3.5.2 persistence layer framework Mybatis Plus3.2.0mybatis data source Fastjson1.2.62JSON processing tool set swagger22.6.1api document generation tools commons-lang33.9 common toolkit commons-io2.6IO toolkit commons-codec1.13 encryption and decryption and other tools Package commons-collections44.4 collection toolkit reflections0.9.11 reflection toolkit hibernate-validator6.0.17.Final background parameter check annotation Shiro1.4.1 permission control JWT3.8.3JSON WEB TOKENhutool-all5.0.3 common tool set lombok1.18.10 annotation generation Java Bean and other tools mapstruct1.3.1.Final object attribute replication tool CHANGELOGCHANGELOG.mdJava DocsJava Api Docs uses clone spring-boot-plusgit clone https://github.com/geekidea/ Spring-boot-plus.gitcd spring-boot-plusMaven construction

The local environment is used by default, and the corresponding configuration file: application-local.yml

Mvn clean package-Plocal5 minutes to complete the addition, deletion, modification and search 1. Create database table-Table structure for foo_bar-- DROP TABLE IF EXISTS `foo_ bar` CREATE TABLE `foo_ bar` (`id`bigint (20) NOT NULL COMMENT 'key', `name` varchar (20) NOT NULL COMMENT 'name', `foo`varchar (20) DEFAULT NULL COMMENT 'Foo', `bar`varchar (20) NOT NULL COMMENT' Bar', `remark` varchar (200) DEFAULT NULL COMMENT 'remarks' `state`int (11) NOT NULL DEFAULT'1' COMMENT 'status 0: disable, 1: enable', `version` int (11) NOT NULL DEFAULT'0' COMMENT 'version', `update_ time`timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'creation time', `update_ time`timestamp NULL DEFAULT NULL COMMENT 'modification time', PRIMARY KEY (`id`)) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'FooBar' -Records of foo_bar---INSERT INTO foo_bar (id, name, foo, bar, remark, state, version, create_time, update_time) VALUES (1, 'FooBar',' foo', 'bar',' remark...', 1, 0 '2019-11-01 14 0515 14 null) INSERT INTO foo_bar (id, name, foo, bar, remark, state, version, create_time, update_time) VALUES (2, 'HelloWorld',' hello', 'world', null, 1, 0,' 2019-11-01 14 purse 05 name 14); 2. Use the code generator to generate add, delete, modify and check code

Modifying database information

Modify component name / author / database table name / primary key id

/ src/test/java/io/geekidea/springbootplus/test/SpringBootPlusGenerator.java/** * spring-boot-plus code generator entry class * * @ author geekidea * @ date 2019-10-22 * * / public class SpringBootPlusGenerator {public static void main (String [] args) {CodeGenerator codeGenerator = new CodeGenerator () / / Public configuration / / Database configuration codeGenerator .setUserName ("root") .setPassword ("root") .setDriverName ("com.mysql.jdbc.Driver") .setDriverUrl ("jdbc:mysql://localhost:3306/spring_boot_plus?useUnicode=true&characterEncoding=UTF-8&useSSL=false") / / package information codeGenerator .setProjectPackagePath ("io/geekidea/springbootplus") .setParentPackage ("io.geekidea.springbootplus"); / / configuration of codeGenerator .setModuleName ("foobar") .setAuthor ("geekidea") .setPkIdColumnName ("id") / / generate policy codeGenerator .setGeneratorStrategy (CodeGenerator.GeneratorStrategy.ALL) .setPageListOrder (true) .setParamValidation (true) / / generate code related to entity mapping, which can be used for database field updates / / when database fields are updated, you can customize which files codeGenerator .setGeneratorEntity (true) .setGeneratorQueryParam (true) .setGeneratorQueryVo (true) are automatically generated. / / generate business-related code codeGenerator .setGeneratorController (true) .setGeneratorService (true) .setGeneratorServiceImpl (true) .setGeneratorMapper (true) .setGeneratorMapperXml (true); / / whether to generate Shiro RequiresPermissions annotation codeGenerator.setRequiresPermissions (false) / / whether to overwrite the existing file codeGenerator.setFileOverride (true); / / initialize the public variable codeGenerator.init (); / / the array of tables to be generated / / xxx,yyy,zzz is the name of the table that needs to generate code: String [] tables = {"foo_bar"}. / / Loop generate for (String table: tables) {/ / set the name of the table to be generated as codeGenerator.setTableName (table); / / generate code codeGenerator.generator ();}

Generated code structure

/ src/main/java/io/geekidea/springbootplus/foobar └── foobar ├── controller │ └── FooBarController.java ├── entity │ └── FooBar.java ├── mapper │ └── FooBarMapper.java ├── param │ └── FooBarQueryParam.java ├── service │ ├── FooBarService.java │ └── impl │ └── FooBarServiceImpl.java └── vo └── FooBarQueryVo.java

> Mapper XML

/ src/main/resources/mapper/foobar/FooBarMapper.xml3. Start the project

Project entry class

/ src/main/java/io/geekidea/springbootplus/SpringBootPlusApplication.java/** * spring-boot-plus Project launch entry * @ author geekidea * @ since 2018-11-08 * / @ EnableAsync@EnableScheduling@EnableTransactionManagement@EnableConfigurationProperties@EnableAdminServer@MapperScan ({"io.geekidea.springbootplus.**.mapper"}) @ SpringBootApplicationpublic class SpringBootPlusApplication {public static void main (String [] args) {/ / launch spring-boot-plus ConfigurableApplicationContext context = SpringApplication.run (SpringBootPlusApplication.class, args) / / print project information PrintApplicationInfo.print (context);}} 4. Access project swagger documents

Http://127.0.0.1:8888/swagger-ui.html

5. System users add, delete, change, query paging Swagger

Quick start

Quick start

Detailed documentation

Https://springboot.plus

CentOS Quick install Environment / build / deploy / start spring-boot-plus Project 1. Download the installation script

Install jdk, git, maven, redis, mysql

Wget-O download-install-all.sh https://springboot.plus/bin/download-install-all.sh2. Run the installation script sh download-install-all.sh3. Modify the MySQL password ALTER USER 'root'@'localhost' IDENTIFIED BY' Spring boot plus 666 password exitmysql-uroot-pSpring bootplus 666 plus 4. Import the MySQL script create database if not exists spring_boot_plus character set utf8mb4;use spring_boot_plus;source / root/mysql_spring_boot_plus.sql;show tables;exit5. Download the deployment script deploy.shwget-O deploy.sh https://springboot.plus/bin/deploy.sh6. Execute the script sh deploy.sh7. Access to the project

SpringBootAdmin administration page

Http://47.105.159.10:8888

Spring-boot-plus Swagger document page

Http://47.105.159.10:8888/docs

8. View the project run log tail-f-n 1000 / root/spring-boot-plus-server/logs/spring-boot-plus.logspring-boot-plus Viewsspring-boot-plus IDEA Sources Views

Spring Boot Admin Instances

Spring Boot Admin Statistics

Spring Boot Admin Log

Spring-boot-plus Swagger document

Spring-boot-plus Java Api Docs

Spring-boot-plus video: movie_camera:

5 minutes to complete the addition, deletion, modification and search

CentOS Quick install JDK/Git/Maven/Redis/MySQL

CentOS rapidly deploy / build / package / run the project

License

Spring-boot-plus is under the Apache 2.0 license. See the LICENSE file for details.

At this point, I believe you have a deeper understanding of "what is spring-boot-plus", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report