springboot整合swagger

加入依赖
                <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.7.0</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.7.0</version>
        </dependency>                         
启动类加注解
@EnableSwagger2

 

 

3、在controller上加注解

@Api(value = "product",tags = {"用户操作接口"}) 


方法上加

@ApiOperation(value = "查询所有")

 

posted @ 2021-08-03 21:19  呵呵可笑  阅读(45)  评论(0编辑  收藏  举报