乐趣区

springbootplus快速开始-Quick-Start一

spring-boot-plus 快速开始 Quick Start

1. clone 项目到本地

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

Or

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

2. maven 构建

默认使用 local 环境, 对应配置文件:application-local.yml

mvn clean package

3. 新建数据库

数据库 MySQL

默认数据库名称为:spring_boot_plus

导入表结构和数据:

spring-boot-plus\docs\spring_boot_plus.sql
-- ----------------------------
-- Table structure for ip
-- ----------------------------
DROP TABLE IF EXISTS `ip`;
CREATE TABLE `ip`  (`ip_start` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ip_end` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `area` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `operator` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `ip_start_num` bigint(20) NOT NULL,
  `ip_end_num` bigint(20) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 526718 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sys_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log`  (`log_id` bigint(18) NOT NULL COMMENT '主键',
  `type` tinyint(1) NULL DEFAULT NULL COMMENT '类型',
  `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容',
  `create_id` bigint(18) NULL DEFAULT NULL COMMENT '创建人 ID',
  `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`log_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统日志' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_log
-- ----------------------------
INSERT INTO `sys_log` VALUES (1060438746056376321, 0, 'A', 100000, '2018-11-08 15:41:58');
INSERT INTO `sys_log` VALUES (1060438788502732802, 0, 'B', 100000, '2018-11-08 15:42:08');
INSERT INTO `sys_log` VALUES (1060438799600861185, 0, 'C', 100000, '2018-11-08 15:42:10');
INSERT INTO `sys_log` VALUES (1060438809495224322, 0, 'D', 100000, '2018-11-08 15:42:13');

ip 表这里只有表结构,第一次使用项目时,可以不用导入 ip 表数据!

https://github.com/geekidea/spring-boot-plus-doc/blob/master/db/ip_data.sql.zip

4. 启动 redis

5. 检查是否安装 lombok 插件

如遇到 log 报错,则需要安装 lombok 插件

???? Eclipse 中使用 spring-boot-plus 项目详细步骤

6. 启动项目

项目启动入口类

SpringBootPlusApplication.java

7. 访问 Spring Boot Admin

???? http://localhost:8888

  • spring-boot-plus 主界面,Spring Boot Admin

8. 访问 Swagger

???? http://localhost:8888/swagger-ui.html

  • Swagger 界面

退出移动版