# quickSpringBoot
**Repository Path**: wei_dongdong/quick-spring-boot
## Basic Information
- **Project Name**: quickSpringBoot
- **Description**: Spring Boot快速开始,maven项目搭建springboot
- **Primary Language**: Java
- **License**: GPL-3.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-30
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# quickSpringBoot
#### 介绍
Spring Boot快速开始,maven项目搭建springboot
#### 软件架构
软件架构说明
#### 安装教程
##### Spring Boot快速开始
###### 1、创建一个maven工程(不需要勾选骨架)
###### 2、连接数据库,用easycode插件生成代码(找到table,右键--EacyCode--Generate Code),Package:cn.kgc

###### 3、导入pom文件头部导入父工程依赖
```
org.springframework.boot
spring-boot-starter-parent
2.1.6.RELEASE
```
###### 4、项目对应的groupid和artifactId不动
###### 5、添加版本控制
```
UTF-8
1.8
```
###### 5、添加依赖
```xml
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-thymeleaf
org.mybatis.spring.boot
mybatis-spring-boot-starter
2.1.3
mysql
mysql-connector-java
runtime
junit
junit
4.11
test
```
###### 6、添加build配置
```xml
src/main/java
**/*.xml
org.springframework.boot
spring-boot-maven-plugin
```
###### 完整的pom.xml文件
```xml
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.1.16.RELEASE
cn.kgc
personManaGer
1.0-SNAPSHOT
UTF-8
1.8
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-thymeleaf
org.mybatis.spring.boot
mybatis-spring-boot-starter
2.1.3
mysql
mysql-connector-java
runtime
junit
junit
4.11
test
src/main/java
**/*.xml
org.springframework.boot
spring-boot-maven-plugin
```
###### 7、application.yml文件配置数据库信息
```yml
server:
port: 8081
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/zx?useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
username: root
password: 123456
mybatis:
type-aliases-package: cn.kgc.entity
```
###### 8、将resource/mapper/下的xml文件移动至src/java/cn/kgc/dao包内
###### 9、dao层接口上添加@Mapper注解,service层的实现类上添加@Service注解
###### 10、创建启动类(类名 = 项目名 + Application)
```java
@SpringBootApplication
public class PersonManaGerApplication {
public static void main(String[] args) {
SpringApplication.run(PersonManaGerApplication.class,args);
}
}
```
###### 11、测试
```bash
http://localhost:8081/person/selectOne?id=2
```
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)