| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | |
| | | |
| | | return R.data(result); |
| | | } |
| | | |
| | | @PostMapping(value = UPLOAD_FILE) |
| | | public String uploadFile(String fileName, MultipartFile file) throws Exception{ |
| | | |
| | | // InputStream inputStream = new ByteArrayInputStream(bytes); |
| | | |
| | | BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | |
| | | String link = bladeFile.getLink(); |
| | | if (link.indexOf("http://10.42.6.251:8082") != -1) { |
| | | link= link.replace("http://10.42.6.251:8082", "https://sk.hubeishuiyi.cn/gminio"); |
| | | } |
| | | return link; |
| | | } |
| | | } |