Metrics
0
Watch 49 Star 256 Fork 94

geekidea / spring-boot-plusJavaApache-2.0

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
Spring-Boot-Plus是易于使用,快速,高效,功能丰富,开源的spring boot 脚手架. spread retract

https://springboot.plus

Clone or download
Loading...
README.md

spring-boot-plus logo

Everyone can develop projects independently, quickly and efficiently!

spring-boot-plus 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.

Front-end and back-end separation, focusing on back-end services

Purpose

Everyone can develop projects independently, quickly and efficiently!

Repository

GITHUB | GITEE

Website

springboot.plus

Features

  • Integrated 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
  • Integrated swagger2, automatic generation of api documents
  • Integrated JWT, spring security permission control
  • Integrated Redis、spring cache、ehcache,etc
  • Integrated Rabbit/Rocket/Kafka MQ
  • Integration alibaba druid connection pool, JDBC performance and slow query detection
  • Integrated Spring Boot Admin, real-time detection of project operation
  • Integrate maven-assembly-plugin for different environment package deployment, including startup and restart commands, and extract configuration files to external config directory

Architecture

spring-boot-plus-architecture.jpg

Project Environment

Middleware 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.1.8.RELEASE Latest release stable version
Spring Framework 5.1.9.RELEASE Latest release stable version
Mybatis 3.5.2 DAO Framework
Mybatis Plus 3.2.0 mybatis Enhanced framework
Alibaba Druid 1.1.20 Data source
Fastjson 1.2.60 JSON processing toolset
swagger2 2.6.1 Api document generation tool
commons-lang3 3.9 Apache language toolkit
commons-io 2.6 Apache IO Toolkit
commons-codec 1.13 Apache Toolkit such as encryption and decryption
commons-collections4 4.4 Apache collections toolkit
reflections 0.9.11 Reflection Toolkit
hibernate-validator 6.0.17.Final Validator toolkit
jwt 0.9.1 JSON WEB TOKEN
hutool-all 4.6.4 Common toolset
lombok 1.18.8 Automatically plugs

CHANGELOG

CHANGELOG.md

Java Docs

Java Api Docs

Getting started

Clone spring-boot-plus

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

Maven Build

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

mvn clean package -Plocal

5 Minutes Finish CRUD

1. Create Table

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
drop table if exists `sys_user`;
create table sys_user(
    id          bigint                              not null comment 'id',
    name        varchar(20)                         null comment 'name',
    account     varchar(20)                         not null comment 'account',
    pwd         varchar(20)                         not null comment 'password',
    remark      varchar(200)                        null comment 'remark',
    create_time timestamp default CURRENT_TIMESTAMP null comment 'create time',
    update_time timestamp                           null comment 'update time',
    primary key (`id`),
    constraint sys_user_account_uindex
        unique (account)
) comment 'SystemUser';
-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO sys_user (id, name, account, pwd, remark, create_time, update_time) VALUES (1, 'Administrator', 'admin', '123456', 'Administrator Account', '2019-08-26 00:52:01', null);

2. Generator CRUD CODE

Modify database info

Modify module name / author / table name / primary key id

/src/test/java/io/geekidea/springbootplus/test/CodeGenerator.java
/**
 * spring-boot-plus Code Generator
 * @author geekidea
 * @date 2018-11-08
 */
public class CodeGenerator {
    private static final String USER_NAME = "root";
    private static final String PASSWORD = "root";
    private static final String DRIVER_NAME = "com.mysql.jdbc.Driver";
    private static final String DRIVER_URL = "jdbc:mysql://localhost:3306/spring_boot_plus?useUnicode=true&characterEncoding=UTF-8&useSSL=false";   
    // CODE... 
    // ############################ Config start ############################
    // Module name
    private static final String MODULE_NAME = "system";
    // Author
    private static final String AUTHOR = "geekidea";
    // Table name
    private static final String TABLE_NAME = "sys_user";
    // Primary key id
    private static final String PK_ID_COLUMN_NAME = "id";
    // Generator strategy.  true:All / false:SIMPLE
    private static final boolean GENERATOR_STRATEGY = true;
    // Pagination list query Whether to sort. true:sort/false:non
    private static final boolean PAGE_LIST_ORDER = false;
    // ############################ Config end ############################

    public static void main(String[] args) {
        // Run...
    }
}

Generated code structure

/src/main/java/io/geekidea/springbootplus/system
└── system
    ├── entity
    │   └── SysUser.java
    ├── mapper
    │   └── SysUserMapper.java
    ├── service
    │   ├── SysUserService.java
    │   └── impl
    │       └── SysUserServiceImpl.java
    └── web
        ├── controller
        │   └── SysUserController.java
        ├── param
        │   └── SysUserQueryParam.java
        └── vo
            └── SysUserQueryVo.java

Mapper XML

/src/main/resources/mapper/system/SysUserMapper.xml

3. Startup Project

Project Main Class

/src/main/java/io/geekidea/springbootplus/SpringBootPlusApplication.java
/**
 * spring-boot-plus Project Main Class
 * @author geekidea
 * @since 2018-11-08
 */
@EnableAsync
@EnableScheduling
@EnableTransactionManagement
@EnableConfigurationProperties
@EnableAdminServer
@MapperScan({"io.geekidea.springbootplus.**.mapper"})
@SpringBootApplication
public class SpringBootPlusApplication {

    public static void main(String[] args) {
        // Run spring-boot-plus
        ConfigurableApplicationContext context = SpringApplication.run(SpringBootPlusApplication.class, args);
        // Print Project Info
        PrintApplicationInfo.print(context);
    }

}

4. Access project swagger docs

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

5. SysUser CRUD Swagger

sys_user_swagger.png

Quick Start

Quick Start

Documentation

https://springboot.plus

CentOS Quick Installation Environment / Build / Deploy / Launch Spring-boot-plus Project

1. Download the installation script

Install jdk, git, maven, redis, mysql

wget -O download-install-all.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/bin/install/download-install-all.sh

2. Run the installation script

sh download-install-all.sh

3. Modify MySQL password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'Springbootplus666!';
exit
mysql -uroot -pSpringbootplus666!

4. Import MySQL scripts

create database if not exists spring_boot_plus character set utf8mb4;
use spring_boot_plus;
source /root/mysql_spring_boot_plus.sql;
show tables;
exit

5. Download deployment script deploy.sh

wget -O deploy.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/deploy/deploy.sh

6. Execution script

sh deploy.sh

7.Access project

SpringBootAdmin Management page

http://47.105.159.10:8888

spring-boot-plus Swagger Document page

http://47.105.159.10:8888/docs

8. View project run log

tail -f -n 1000 /root/spring-boot-plus-server/logs/spring-boot-plus.log

spring-boot-plus Video :movie_camera:

Contact

spring-boot-plus QQ Group

License

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

Comments ( 15 )

You need to Sign in for post a comment

Java
1
https://gitee.com/geekidea/spring-boot-plus.git
git@gitee.com:geekidea/spring-boot-plus.git

Help Search