同步操作将从 geekidea/spring-boot-plus 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Everyone can develop projects independently, quickly and efficiently!
Spring-Boot-Plus是易于使用,快速,高效,功能丰富,开源的spring boot 脚手架.
每个人都可以独立、快速、高效地开发项目!
任何个人或公司,均可基于此框架进行二次开发后,进行商业使用,无需授权!
spring-boot-plus
├── main
│ ├── java
│ │ └── io
│ │ └── geekidea
│ │ └── boot
│ │ └── auth
│ │ └── config
│ │ └── foobar
│ │ └── framework
│ │ └── system
│ │ └── SpringBootPlusApplication.java
│ └── resources
│ ├── application-dev.yml
│ ├── application-prod.yml
│ ├── application-test.yml
│ ├── application.yml
│ ├── banner.txt
│ ├── mapper
│ └── static
└── test
├── java
│ └── io
└── resources
└── templates
名称 | 版本 | 备注 |
---|---|---|
JDK | 1.8+ | JDK1.8及以上 |
MySQL | 5.7+ | 5.7及以上 |
Redis | 3.2+ |
技术 | 版本 | 备注 |
---|---|---|
spring boot | 2.7.12 | |
mybatis-plus | 3.5.3.1 | mybatis增强框架 |
fastjson2 | 2.0.33 | JSON处理工具集 |
Swagger | V3 | Swagger文档 |
knife4j | 4.1.0 | api文档生成工具 |
commons-lang3 | 3.12.0 | 常用工具包 |
commons-io | 2.11.0 | IO工具包 |
commons-codec | 1.15 | 加密解密等工具包 |
commons-collections4 | 4.4.4 | 集合工具包 |
hibernate-validator | 6.2.5.Final | 后台参数校验注解 |
hutool-all | 5.8.16 | 常用工具集 |
lombok | 1.18.26 | 注解生成Java Bean等工具 |
git clone https://gitee.com/geekidea/spring-boot-plus.git
cd spring-boot-plus
默认使用dev环境,对应配置文件:application-dev.yml
mvn clean package -Pdev
-- ----------------------------
-- Table structure for foo_bar
-- ----------------------------
DROP TABLE IF EXISTS `foo_bar`;
create table foo_bar
(
id bigint not null comment '主键'
primary key,
name varchar(20) not null comment '名称',
foo varchar(100) null comment 'Foo',
bar varchar(100) null comment 'Bar',
remark varchar(200) null comment '备注',
status tinyint(1) default 1 not null comment '状态,0:禁用,1:启用',
create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间',
update_time timestamp null comment '修改时间'
)
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);
代码生成入口类,在generator模块中
src/test/java/io/geekidea/boot/generator/Generator.java
/**
* Spring Boot Plus 代码生成器
*
* @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);
}
}
├── controller
│ └── FooBarController.java
├── dto
│ ├── FooBarAddDto.java
│ └── FooBarUpdateDto.java
├── entity
│ └── FooBar.java
├── mapper
│ └── FooBarMapper.java
├── query
│ └── FooBarQuery.java
├── service
│ ├── FooBarService.java
│ └── impl
│ └── FooBarServiceImp.java
└── vo
├── FooBarInfoVo.java
└── FooBarVo.java
resources
└── mapper
└── foobar
└── FooBarMapper.xml
使用Velocity模版生成代码,可自定义修改代码生成模版
src/test/resources
└── templates
├── addDto.java.vm 添加DTO代码生成模版
├── controller.java.vm 控制器代码生成模版
├── entity.java.vm 实体类代码生成模版
├── infoVo.java.vm 详情VO代码生成模版
├── mapper.java.vm Mapper代码生成模版
├── mapper.xml.vm Mapper xml 代码生成模版
├── query.java.vm 分页参数代码生成模版
├── service.java.vm 服务接口代码生成模版
├── serviceImpl.java.vm 服务实现代码生成模版
├── updateDto.java.vm 修改DTO代码生成模版
└── vo.java.vm 列表VO代码生成模版
项目入口类: SpringBootPlusApplication http://localhost:8888
src/main/java/io/geekidea/boot/SpringBootPlusApplication.java
/**
* 启动类
*
* @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");
}
}
http://localhost:8888/swagger-ui/index.html
http://localhost:8888/doc.html
QQ 625301326 | 微信公众号 geekideaio | 今日头条 GeekIdea |
---|---|---|
请作者喝咖啡,让代码飞一会儿!
spring-boot-plus is under the MIT-License. See the LICENSE file for details.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。