Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

๐Ÿ”ฅ Spring-Boot-Plus is an easy-to-use, high-speed, high-efficient,feature-rich, open source spring boot scaffolding. ๐Ÿš€

License

Notifications You must be signed in to change notification settings

geekidea/spring-boot-plus

Repository files navigation

spring-boot-plus logo

Everyone can develop projects independently, quickly and efficiently!

spring-boot-plus version spring boot version spring boot version code style

What is spring-boot-plus?

A easy-to-use, high-speed, high-efficient, feature-rich, open source spring boot scaffolding.

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

Purpose

Everyone can develop projects independently, quickly and efficiently!

Open source License MIT-License

Any individual or company can conduct secondary development based on this framework for commercial use without authorization!

Vue Project VUE3+TS

Features

  • Integrated spring boot common development component set, common configuration, AOP log, etc
  • Maven Project
  • Integrated mybatis-plus fast dao operation
  • Quickly generate background code:entity/param/vo/controller/service/mapper/xml
  • Integrated Swagger/Knife4j, automatic generation of api documents
  • Integrated Redis Cache
  • Integration HikariCP connection pool, A solid, high-performance, JDBC connection pool at last.

Source code directory structure

spring-boot-plus
โ”œโ”€โ”€ docs
โ”‚ โ”œโ”€โ”€ bin
โ”‚ โ”‚ โ””โ”€โ”€ install
โ”‚ โ”œโ”€โ”€ config
โ”‚ โ”œโ”€โ”€ db
โ”‚ โ””โ”€โ”€ img
โ”œโ”€โ”€ logs
โ””โ”€โ”€ src
 โ”œโ”€โ”€ main
 โ”‚ โ”œโ”€โ”€ java
 โ”‚ โ”‚ โ””โ”€โ”€ io
 โ”‚ โ”‚ โ””โ”€โ”€ geekidea
 โ”‚ โ”‚ โ””โ”€โ”€ boot
 โ”‚ โ”‚ โ”œโ”€โ”€ auth
 โ”‚ โ”‚ โ”œโ”€โ”€ common
 โ”‚ โ”‚ โ”œโ”€โ”€ config
 โ”‚ โ”‚ โ”œโ”€โ”€ demo
 โ”‚ โ”‚ โ”œโ”€โ”€ framework
 โ”‚ โ”‚ โ”œโ”€โ”€ system
 โ”‚ โ”‚ โ”œโ”€โ”€ user
 โ”‚ โ”‚ โ””โ”€โ”€ util
 โ”‚ โ”‚ โ””โ”€โ”€ SpringBootPlusApplication.java
 โ”‚ โ””โ”€โ”€ resources
 โ”‚ โ”œโ”€โ”€ mapper
 โ”‚ โ””โ”€โ”€ static
 โ”‚ โ”œโ”€โ”€ application-dev.yml
 โ”‚ โ”œโ”€โ”€ application-prod.yml
 โ”‚ โ”œโ”€โ”€ application-test.yml
 โ”‚ โ”œโ”€โ”€ application.yml
 โ”‚ โ”œโ”€โ”€ banner.txt
 โ”‚ โ”œโ”€โ”€ ip2region.xdb
 โ”‚ โ”œโ”€โ”€ logback-spring.xml
 โ””โ”€โ”€ test
 โ”œโ”€โ”€ java
 โ”‚ โ””โ”€โ”€ io
 โ”‚ โ””โ”€โ”€ geekidea
 โ”‚ โ””โ”€โ”€ boot
 โ”‚ โ”œโ”€โ”€ generator
 โ”‚ โ””โ”€โ”€ system
 โ””โ”€โ”€ resources
 โ””โ”€โ”€ templates

Project Environment

Name Version Remark
JDK 1.8+ JDK1.8 and above
MySQL 5.7+ 5.7 and above
Redis 3.2+

Technology stack

Component Version Remark
Spring Boot 2.7.18
Mybatis 3.5.13 DAO Framework
Mybatis Plus 3.5.4.1 mybatis Enhanced framework
Fastjson 2.0.42 JSON processing toolset
Swagger V3 Api document generation tool
Knife4j 4.3.0 Api document generation tool
commons-lang3 3.14.0 Apache language toolkit
commons-io 2.15.0 Apache IO Toolkit
commons-codec 1.16.0 Apache Toolkit such as encryption and decryption
commons-collections4 4.4.4 Apache collections toolkit
hibernate-validator 6.2.5.Final Validator toolkit
hutool-all 5.8.23 Common toolset
lombok 1.18.30 Automatically plugs

Project Link Diagram

้กน็›ฎ่ฐƒ็”จ้“พ่ทฏๅ›พ

Quick Start

Clone spring-boot-plus

git clone https://github.com/geekidea/spring-boot-plus.git
cd spring-boot-plus

Maven Build

dev environment is used by default, The configuration file:application-dev.yml

mvn clean package -Pdev

5 Minutes Finish CRUD

1. Create Table

-- ----------------------------
-- Table structure for foo_bar
-- ----------------------------
DROP TABLE IF EXISTS `foo_bar`;
CREATE TABLE `foo_bar`
(
 `id` bigint(20) NOT NULL COMMENT 'ID',
 `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 'Remark',
 `state` int(11) NOT NULL DEFAULT '1' COMMENT 'State,0:Disable,1:Enable',
 `version` int(11) NOT NULL DEFAULT '0' COMMENT 'Version',
 `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create Time',
 `update_time` timestamp NULL DEFAULT NULL COMMENT 'Update Time',
 PRIMARY KEY (`id`)
) ENGINE = InnoDB
 DEFAULT CHARSET = utf8mb4
 COLLATE = utf8mb4_general_ci COMMENT ='FooBar';
create table foo_bar
(
 id bigint not null comment 'ID'
 primary key,
 name varchar(20) not null comment 'Name',
 foo varchar(100) null comment 'Foo',
 bar varchar(100) null comment 'Bar',
 remark varchar(200) null comment 'Remark',
 status tinyint(1) default 1 not null comment 'Status,0:Disable,1:Enable',
 create_time timestamp default CURRENT_TIMESTAMP null comment 'Create Time',
 update_time timestamp null comment 'Update Time'
)
 comment 'FooBar';
-- ----------------------------
-- Records of foo_bar
-- ----------------------------
INSERT INTO foo_bar (id, name, foo, bar, remark, status, create_time, update_time) VALUES (1, 'FooBar', 'Foo', 'Bar', null, 1, '2023ๅนด07ๆœˆ01ๆ—ฅ 21:01:10', null);

2. Generator CRUD CODE

Code generation entry class, in the generator module

src/test/java/io/geekidea/boot/generator/Generator.java
/**
 * spring-boot-plus Code Generator Main Class
 *
 * @author geekidea
 * @date 2022ๅนด3ๆœˆ16ๆ—ฅ
 **/
public class Generator {
 public static void main(String[] args) throws Exception {
 GeneratorConfig config = new GeneratorConfig();
 // ้กน็›ฎไฟกๆฏ้…็ฝฎ
 config.setParentPackage("io.geekidea.boot" )
 .setModuleName("foobar" )
 .setAuthor("geekidea" );
 // ่กจๅ็งฐๅ’Œ้œ€่ฆๅŽปๆމ็š„่กจๅ‰็ผ€
 config.setTableNames("foo_bar" )
 .setTablePrefix("");
 // ๆ˜ฏๅฆ่ฆ†็›–ๅทฒๆœ‰ๆ–‡ไปถ
 config.setFileOverride(true);
 // ๆ˜ฏๅฆๅชๆ›ดๆ–ฐๅฎžไฝ“็ฑป
 config.setOnlyOverrideEntity(false);
 GenerateHandler handler = new GenerateHandler();
 handler.generator(config);
 }
}

Generated code structure

โ”œโ”€โ”€ controller
โ”‚ โ””โ”€โ”€ FooBarController.java
โ”œโ”€โ”€ dto
โ”‚ โ”œโ”€โ”€ FooBarDto.java
โ”‚ โ””โ”€โ”€ FooBarUpdateDto.java
โ”œโ”€โ”€ entity
โ”‚ โ””โ”€โ”€ FooBar.java
โ”œโ”€โ”€ mapper
โ”‚ โ””โ”€โ”€ FooBarMapper.java
โ”œโ”€โ”€ query
โ”‚ โ””โ”€โ”€ FooBarQuery.java
โ”œโ”€โ”€ service
โ”‚ โ”œโ”€โ”€ FooBarService.java
โ”‚ โ””โ”€โ”€ impl
โ”‚ โ””โ”€โ”€ FooBarServiceImp.java
โ””โ”€โ”€ vo
 โ”œโ”€โ”€ FooBarVo.java
 โ””โ”€โ”€ FooBarVo.java
resources
โ””โ”€โ”€ mapper
 โ””โ”€โ”€ foobar
 โ””โ”€โ”€ FooBarMapper.xml 

Code Generator Templates

Use Velocity template to generate code, you can customize and modify the code to generate template

src/test/resources
โ””โ”€โ”€ templates
 โ”œโ”€โ”€ addDto.java.vm Add DTO generator template
 โ”œโ”€โ”€ controller.java.vm Controller generator template
 โ”œโ”€โ”€ entity.java.vm Entity generator template
 โ”œโ”€โ”€ infoVo.java.vm Detail VO generator template
 โ”œโ”€โ”€ mapper.java.vm Mapper generator template
 โ”œโ”€โ”€ mapper.xml.vm Mapper xml generator template
 โ”œโ”€โ”€ query.java.vm Page Query generator template
 โ”œโ”€โ”€ service.java.vm Service generator template
 โ”œโ”€โ”€ serviceImpl.java.vm Service implement generator template
 โ”œโ”€โ”€ updateDto.java.vm Update DTO generator template
 โ””โ”€โ”€ vo.java.vm List VO generator template

3. Startup Project

Project Main Class: SpringBootPlusApplication http://localhost:8888

src/main/java/io/geekidea/boot/SpringBootPlusApplication.java
/**
 * spring-boot-plus Project Main Class
 *
 * @author geekidea
 * @date 2022ๅนด3ๆœˆ16ๆ—ฅ
 */
@EnableAsync
@SpringBootApplication
public class SpringBootPlusApplication {
 private static final String BACKSLASH = "/";
 public static void main(String[] args) throws Exception {
 ConfigurableApplicationContext context = SpringApplication.run(SpringBootPlusApplication.class, args);
 // ๆ‰“ๅฐ้กน็›ฎไฟกๆฏ
 printlnProjectInfo(context);
 System.out.println(" _____ _______ _____ _______ _____ _ _ _____ _____ ______ _____ _____ \n" +
 " / ____|__ __|/\\ | __ \\__ __| / ____| | | |/ ____/ ____| ____|/ ____/ ____|\n" +
 "| (___ | | / \\ | |__) | | | | (___ | | | | | | | | |__ | (___| (___ \n" +
 " \\___ \\ | | / /\\ \\ | _ / | | \\___ \\| | | | | | | | __| \\___ \\\\___ \\ \n" +
 " ____) | | |/ ____ \\| | \\ \\ | | ____) | |__| | |___| |____| |____ ____) |___) |\n" +
 "|_____/ |_/_/ \\_\\_| \\_\\ |_| |_____/ \\____/ \\_____\\_____|______|_____/_____/ \n");
 }
}

4. Access Swagger Docs

http://localhost:8888/swagger-ui/index.html swagger-ui.png

5. Access Knife4j Docs

http://localhost:8888/doc.html knife4j.png

spring-boot-plus-vue Vue3 Project

System User List

System User List

System Role List

System Role List

System Menu List

System Menu List

System Department

System Department List

System Log List

System Log List System Log Detail

User Profile

User Profile

spring-boot-plus Videos ๐ŸŽฅ

QQ็พค 625301326 ๅพฎไฟกๅ…ฌไผ—ๅท geekideaio
spring-boot-plus QQ Group Wechat Official Account
ๅพฎไฟกๆŠ€ๆœฏไบคๆต็พค ไธšๅŠกๅ’จ่ฏขๅ•†ๅŠกๅˆไฝœ
ๅพฎไฟก็พค ไธšๅŠกๅ’จ่ฏขๅ•†ๅŠกๅˆไฝœ

License

spring-boot-plus is under the MIT-License. See the LICENSE file for details.

About

๐Ÿ”ฅ Spring-Boot-Plus is an easy-to-use, high-speed, high-efficient,feature-rich, open source spring boot scaffolding. ๐Ÿš€

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages

AltStyle ใซใ‚ˆใฃใฆๅค‰ๆ›ใ•ใ‚ŒใŸใƒšใƒผใ‚ธ (->ใ‚ชใƒชใ‚ธใƒŠใƒซ) /