开发环境

jdk 1.8

Spring Boot :2.1.1.RELEASE

Maven:3.6.3

开发工具:eclipse

以上环境配置好,插件安装上

1、创建项目

spring boot微服务基础框架搭建笔记

2、项目创建后的目录结构

spring boot微服务基础框架搭建笔记

3、项目创建后,启动类和pom.xml自动创建

spring boot微服务基础框架搭建笔记

spring boot微服务基础框架搭建笔记

4、注解

@SpringBootApplication是一个复合注解,记录下重要的三个

          @SpringBootConfiguration:复合注解,其中最重要的是@Configration指明该类由Spring容器管理

          @EnableAutoConfiguration:该注解用于启动服务自动配置功能

          @ComponentScan:该注解用于扫描类,其作用类似于Spring中的<xontext:component-scan>标签。

 

@RestController注解,复合注解,其中比较重要的

          @Controller和@ResponseBody,指定controller返回的对象自动转化为json格式并返回(基本类型及包装类、String除外)

 

       

           

 

相关文章:

  • 2021-07-12
  • 2021-12-22
  • 2022-01-12
  • 2021-07-23
  • 2021-05-20
  • 2022-03-09
  • 2022-12-23
  • 2021-09-13
猜你喜欢
  • 2022-12-23
  • 2021-05-22
  • 2021-10-26
  • 2021-03-30
  • 2021-09-05
  • 2021-07-26
  • 2022-12-23
相关资源
相似解决方案