| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.file.FileUtils; |
| | | import com.ruoyi.file.service.ISysFileService; |
| | | import com.ruoyi.file.utils.StateCloudObsUtil; |
| | | import com.ruoyi.system.api.domain.SysFile; |
| | | import com.ruoyi.system.api.util.StateCloudObsUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestPart; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/obs/upload/stream") |
| | | public R<String> obsUpload(@RequestParam("code") String code, |
| | | @RequestParam("stream") InputStream stream) { |
| | | try { |
| | | // 上传并返回访问地址 |
| | | String url = StateCloudObsUtil.obsUploadStream(code, stream); |
| | | return R.ok(url); |
| | | } catch (Exception e) { |
| | | log.error("上传文件失败", e); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | } |