赞
踩
3.添加框架
2.Model
3.Service
4.Iservice
5.mapper
pom.xml 加入 Swagger
io.springfox springfox-swagger2 2.9.2io.springfox springfox-swagger-ui 2.9.2
启动项 加入@EnableSwagger2 注解
#访问根路径#应用名称spring.application.name=springboot-demo#访问端口号server.port=8080#编码格式server.tomcat.uri-encoding=utf-8#数据库相关配置spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driverspring.datasource.url=jdbc:mysql://10.0.2.25:3306/budget?supervision=utf8&autoReconnect=true&useSSL=truespring.datasource.username=rootspring.datasource.password=1234.abcdspring.datasource.max-idle=10spring.datasource.max-wait=10000spring.datasource.min-idle=5spring.datasource.initial-size=5#session生命周期server.servlet.session.timeout=30m
启动 非常快 就几秒钟
http://localhost:8080/swagger-ui.html
或者在浏览器 输入
http://localhost:8080/login?account=admin&password=1234
各位小伙伴,有了Spring Boot 后,搭建一个restful风格的框架是不是很简单呢?
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。