1 SpingBoot简介
1.1 创建SpringBoot项目
- 创建



- 层次

boot程序最基本的架子
- 开发
@RestController
@RequestMapping("/books")
public class BookController {
    @GetMapping("/{id}")
    public String getById(@PathVariable Integer id){
        System.out.println("id ==> "+id);
        return "hello , spring boot!";
    }
}
启动直接启动Application类即可
@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
- pom核心配置
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.5.0.RELEASE</version>
</parent>
主要靠这个继承了
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
		</dependency>
- 官网下载运行环境spring initializr
  
1.2 SpringBoot快速启动
-  实现前后端分离合作开发 
  
-  打包 



- 起步依赖
去父工程继承

版本已经帮你配好了,以及版本的依赖管理
 
- 辅助功能
- 排除Tomcat服务器

- 加入jetty

2 基础配置
2.1 配置文件格式
- application.properties
修改端口号
 
- application.yml

- application.yaml

- 细节
写配置的时候万一没有提示



- 优先级

2.2 yaml格式
- 几个格式对比
yaml重数据轻格式

2, 语法规则

- 数组格式

2.3 yaml数据读取方式
-  yaml内容 
  
-  读取 
- 普通

- 数组

- 类

- 实体类


最后

结果

运用:用在mybatis对应信息配上,然后用一个实体类,加载yaml的配置信息,实体类就可以得到对象
剩下的明天学



















