springboot+jpa+mysql+swagger2.0整合

Springboot+jpa+MySQL+swagger整合

创建一个springboot web项目

   
      org.springframework.boot
      spring-boot-starter-web
   

   
   
      org.springframework.boot
      spring-boot-starter-data-jpa
   
   
      mysql
      mysql-connector-java
   
   
      org.springframework.boot
      spring-boot-starter-tomcat
      provided
   
   
   
      org.springframework.boot
      spring-boot-devtools
   
   
   
      com.alibaba
      fastjson
      1.2.16
   

   
   
      com.alibaba
      druid
      1.0.25
   

   
      org.apache.poi
      poi
      3.14
   

   
      org.springframework.boot
      spring-boot-starter-test
      test
   

   
   
      io.springfox
      springfox-swagger2
      2.8.0
   
   
      io.springfox
      springfox-swagger-ui
      2.8.0
   
   
      io.swagger
      swagger-annotations
      1.5.14
   

   
      org.springframework.boot
      spring-boot-starter-tomcat
   

   
      com.google.code.gson
      gson
      2.8.2
   

   
      org.projectlombok
      lombok
   

二、添加swagger的资源文件,配置application.yml文件

 

三、配置swagger

 

 

 

Swagger访问的路径:

 

Postman访问的路径:

 

SpringBoot  Jpa使用

评论

暂无评论