前言
- 若依(ruoyi): v4.3
- swagger 1.5.21 (https://github.com/swagger-api/swagger-core)
Swagger 上传接口定义
/**
* 文件上传接口
*/
@ApiOperation(value = "上传文件", notes = "上传文件")
@PostMapping(value = "/file")
@ResponseBody
public AjaxResult uploadFile(MultipartFile file) throws Exception{
// do something
}
运行效果:
修饰接口
/**
* 文件上传接口
*/
@ApiOperation(value = "上传文件", notes = "上传文件接口")
@PostMapping(value = "/file")
@ResponseBody
public AjaxResult uploadFile(@ApiParam(value = "上传文件", required = true) @RequestParam("uploadFile")MultipartFile file) throws Exception
{
// do something
}
运行效果: