rain
2024-04-17 b6294bd36b3023e18606c77553fe136e6500a4b2
src/main/java/com/dji/sample/media/service/impl/MediaServiceImpl.java
@@ -27,6 +27,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.messaging.MessageHeaders;
import org.springframework.stereotype.Service;
@@ -71,6 +72,10 @@
    @Autowired
    private IFileMapper mapper;
    @Value("${oss.out-net-file-address}")
    private String fileAddress;
    @Value("${oss.bucket}")
    private String bucket;
    @Override
    public Boolean fastUpload(String workspaceId, String fingerprint) {
        return fileService.checkExist(workspaceId, fingerprint);
@@ -101,13 +106,14 @@
    @Override
    public PaginationData<MediaJobDTO> mediaPage(String workspaceId, SearchMediaParam param) {
        param.setFileAddress(fileAddress+"/"+bucket);
        Page<MediaJobDTO> waylineJobDTOPage = mapper.mediaPage(new Page<MediaJobDTO>(param.getPage(), param.getPageSize()), workspaceId, param);
        return new PaginationData<MediaJobDTO>(waylineJobDTOPage.getRecords(), new Pagination(waylineJobDTOPage));
    }
    @Override
    public PaginationData<MediaJobDTO> mediaDetail( String jobId,Long page, Long pageSize) {
        Page<MediaJobDTO> waylineJobDTOPage = mapper.mediaDetail(new Page<MediaJobDTO>(page, pageSize), jobId);
        Page<MediaJobDTO> waylineJobDTOPage = mapper.mediaDetail(new Page<MediaJobDTO>(page, pageSize), jobId,fileAddress+"/"+bucket);
        return new PaginationData<MediaJobDTO>(waylineJobDTOPage.getRecords(), new Pagination(waylineJobDTOPage));
    }
@@ -146,7 +152,7 @@
                log.error("保存文件到数据库失败,请手动检查数据;Failed to save the file to the database, please check the data manually.");
                return null;
            }
        } else if (!StringUtils.isEmpty(jobId)) { //一键起飞操作需要上传文件
        } else if (!StringUtils.isEmpty(jobId)) { //一键起飞操作需要
            WaylineJobDTO waylineJobDTO = new WaylineJobDTO();
            waylineJobDTO.setWorkspaceId(device.getWorkspaceId());
            waylineJobDTO.setDockSn(device.getDeviceSn());