@ApiOperation 和 @Api 用法

作用:用于解释说明

使用方法:

在pom文件中引入依赖

<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger2</artifactId>
  <version>2.2.2</version>
</dependency>

举例:

@RestController
@RequestMapping("/xxx")
@Api(tags = {"系统常量"})
public class xxxController {
    @PostMapping
    @ApiOperation(value = "方法作用")
    public OptionResult<?> sss() throws Exception {
           return xxxxxxx;
    }
}

注解@ApiOperation是用来构建Api文档

    1. 使用于在方法上,表示一个http请求的操作
    2. @ApiOperation(value = “接口说明”, httpMethod = “接口请求方式”, response =
      “接口返回参数类型”, notes = “接口发布说明”;其他参数可参考源码;

引用:

https://blog.csdn.net/mumuwang1234/article/details/117386242

posted @ 2023-07-26 10:59  E-青稞  阅读(795)  评论(0)    收藏  举报