diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/CommonController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/CommonController.java new file mode 100644 index 000000000..d5bd74852 --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/CommonController.java @@ -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 uploadFile(@RequestParam MultipartFile file){ + log.info("传入>>>>>>>>>>{}",file); + BladeFile bladeFile = minioTemplate.putFile(file); + return R.data(bladeFile); + } +}