吉安感知网项目-后端
linwei
2026-06-09 b486873000ea043f159c8de5c0edb123c0f38a87
drone-ops/drone-resource/src/main/java/org/sxkj/resource/endpoint/OssEndpoint.java
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@@ -188,7 +189,7 @@
    @PostMapping("/put-file-attach-by-name")
    @ApiOperation(value = "上传文件并保存至附件表", notes = "上传文件并保存至附件表-存储桶对象名称")
    public R<BladeFile> putFileAttach(@RequestParam String fileName,
                                      @RequestParam String resultType,
                                      @RequestParam List<List<String>> resultType,
                                      @RequestParam MultipartFile file) {
        BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream());
        Long attachId = buildAttach(fileName, resultType, file.getSize(), bladeFile);
@@ -224,7 +225,7 @@
    private BladeFile getBladeFile(@RequestParam MultipartFile file) throws IOException {
        String fileName = file.getOriginalFilename();
        BladeFile bladeFile = ossBuilder.template("estack").putFile(fileName, file.getInputStream());
        Long attachId = buildAttach(fileName, "", file.getSize(), bladeFile);
        Long attachId = buildAttach(fileName, null, file.getSize(), bladeFile);
        bladeFile.setAttachId(attachId);
        return bladeFile;
    }
@@ -237,7 +238,7 @@
     * @param bladeFile 对象存储文件
     * @return attachId
     */
    private Long buildAttach(String fileName, String resultType, Long fileSize, BladeFile bladeFile) {
    private Long buildAttach(String fileName, List<List<String>> resultType, Long fileSize, BladeFile bladeFile) {
        String fileExtension = FileUtil.getFileExtension(fileName);
        Attach attach = new Attach();
        attach.setDomainUrl(bladeFile.getDomain());