Spring Boot基础-RESTfull API简单项目的快速搭建

Spring Boot基础教程1-Spring Tool Suite工具的安装

Spring Boot基础教程2-RESTfull API简单项目的快速搭建

Spring Boot基础教程3-配置文件详解:Properties和YAML

Spring Boot基础教程4-配置文件-多环境配置

Spring Boot基础教程5-日志配置-logback和log4j2

视频教程:http://www.roncoo.com/course/view/c99516ea604d4053908c1768d6deee3d

源码地址:https://github.com/roncoo/spring-boot-demo

一、搭建一个简单的RESTfull API接口项目

Spring Boot基础-RESTfull API简单项目的快速搭建_第1张图片

1.spring-boot-starter-web的引入,其依赖包的学习

Spring Boot基础-RESTfull API简单项目的快速搭建_第2张图片

2.spring-boot-devtools的引入,其依赖包的学习

Spring Boot基础-RESTfull API简单项目的快速搭建_第3张图片

3.代码的实现

Spring Boot基础-RESTfull API简单项目的快速搭建_第4张图片
Spring Boot基础-RESTfull API简单项目的快速搭建_第5张图片

4.运行项目

直接运行main方法或者使用maven命令: spring-boot:run

测试:http://localhost:8080/index

带参数:http://localhost:8080/index/get?name=wujing

带参数有中文:http://localhost:8080/index/get?name=无境

url测试:http://localhost:8080/index/get/1/wujing

url测试:http://localhost:8080/index/get/1/无境

5.打包

命令: clean package

Spring Boot基础-RESTfull API简单项目的快速搭建_第6张图片
Spring Boot基础-RESTfull API简单项目的快速搭建_第7张图片

6.运行命令: java –jar roncoo-education-0.0.1-SNAPSHOT.jar

你可能感兴趣的:(Spring Boot基础-RESTfull API简单项目的快速搭建)