Skip to content

RocPeng/Spring-Boot-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

springboot_0

SpringBoot整合spring data jpa
访问地址:http://localhost:8898/
templates/welcome.html:http://localhost:8898/user
templates/user/index.html:http://localhost:8898/user/index
接口:http://localhost:8898/user/show?username=Roc_Peng
请求方式:Get/Post
请求参数:

{
	"username":"Roc_Peng"
}

返回结果:

{
    "id": 1,
    "username": "Roc_Peng",
    "birthday": 1502121600000,
    "sex": "2",
    "address": null
}

springboot_1

SpringBoot整合mybatis,mybatis分别采用注解和配置文件两种方式
访问地址:http://localhost:8899/
主页:http://localhost:8899/user/
接口1:http://localhost:8899/user/query/{id}
接口2:http://localhost:8899/user/select/{id}
example:访问http://localhost:8899/user/select/1
返回:

{
id: 1,
username: "Roc_Peng",
birthday: 1502121600000,
sex: "2",
address: null
}

springboot_2

SpringBoot整合mybatis,并使用分页插件 PageHelper和通用 Mapper,原作者blog地址,github地址
访问地址:http://localhost:8900/
接口1:http://localhost:8900/user
返回数据格式:json
返回内容:user的list集合
接口2:http://localhost:8900/user/query/{id}
返回数据格式:json
返回内容:id对应的user

服务端部署运行

因为springboot项目内置了tomcat应用,而且最后打包出来的结果是jar包,因此不依赖外部Tomcat服务器,于是我们可以使用mvn clean package命令先将项目打成jar包,然后使用java -jar命令运行jar包即可.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published