update 使用 @param 注释替换 @Parameter 注解

fix 修复 token 无法传递 与 无法持久化问题
This commit is contained in:
疯狂的狮子li
2022-07-08 15:49:15 +08:00
parent d9e54388e7
commit dd25573ebc
40 changed files with 464 additions and 227 deletions
@@ -1,10 +1,8 @@
package com.ruoyi.demo.controller;
import com.ruoyi.common.core.domain.R;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
@@ -16,7 +14,7 @@ import org.springframework.web.multipart.MultipartFile;
*
* @author Lion Li
*/
@Tag(name ="演示swagger3控制器", description = "演示swagger3接口")
@Tag(name = "演示swagger3控制器", description = "演示swagger3接口")
@RestController
@RequestMapping("/swagger/demo")
public class Swagger3DemoController {
@@ -24,11 +22,10 @@ public class Swagger3DemoController {
/**
* 上传请求
* 必须使用 @RequestPart 注解标注为文件
*
* @param file 文件
*/
@Parameters({
@Parameter(name = "file", description = "文件", in = ParameterIn.QUERY, required = true)
})
@PostMapping(value = "/upload")
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R<String> upload(@RequestPart("file") MultipartFile file) {
return R.ok("操作成功", file.getOriginalFilename());
}