caoyizhong
2 years ago
1 changed files with 31 additions and 0 deletions
@ -0,0 +1,31 @@ |
|||||||
|
package com.logpm.basicdata.controller; |
||||||
|
|
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.SneakyThrows; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.oss.MinioTemplate; |
||||||
|
import org.springblade.core.oss.model.BladeFile; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
import org.springframework.web.multipart.MultipartFile; |
||||||
|
|
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@Api(value = "公共",tags = "公共") |
||||||
|
@RequestMapping("/common") |
||||||
|
@Slf4j |
||||||
|
public class CommonController { |
||||||
|
|
||||||
|
private MinioTemplate minioTemplate; |
||||||
|
@SneakyThrows |
||||||
|
@PostMapping("/uploadFile") |
||||||
|
public R<BladeFile> uploadFile(@RequestParam MultipartFile file){ |
||||||
|
log.info("传入>>>>>>>>>>{}",file); |
||||||
|
BladeFile bladeFile = minioTemplate.putFile(file); |
||||||
|
return R.data(bladeFile); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue