¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestPart; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * swagger3 ç¨æ³ç¤ºä¾ |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Api(value = "æ¼ç¤ºswagger3æ§å¶å¨", tags = {"æ¼ç¤ºswagger3æ¥å£"}) |
| | | @RestController |
| | | @RequestMapping("/swagger/demo") |
| | | public class Swagger3DemoController { |
| | | |
| | | /** |
| | | * ä¸ä¼ è¯·æ± |
| | | * å¿
é¡»ä½¿ç¨ @RequestPart æ³¨è§£æ æ³¨ä¸ºæä»¶ |
| | | * dataType å¿
须为 "java.io.File" |
| | | */ |
| | | @ApiOperation(value = "éç¨ä¸ä¼ 请æ±") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "file", value = "æä»¶", dataType = "java.io.File", required = true), |
| | | }) |
| | | @PostMapping(value = "/upload") |
| | | public AjaxResult<String> upload(@RequestPart("file") MultipartFile file) { |
| | | return AjaxResult.success("æä½æå", file.getOriginalFilename()); |
| | | } |
| | | |
| | | } |