rain
2024-08-21 e945a560b26437d610754cea5abfd992cd63fd7b
src/main/java/com/dji/sample/media/service/IFileService.java
@@ -1,9 +1,16 @@
package com.dji.sample.media.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dji.sample.common.model.PaginationData;
import com.dji.sample.media.model.FileUploadDTO;
import com.dji.sample.media.model.MediaFileDTO;
import com.dji.sample.common.model.ResponseResult;
import com.dji.sample.media.model.*;
import com.drew.imaging.ImageProcessingException;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.List;
@@ -16,6 +23,7 @@
    /**
     * Query if the file already exists based on the workspace id and the fingerprint of the file.
     *
     * @param workspaceId
     * @param fingerprint
     * @return
@@ -24,41 +32,97 @@
    /**
     * Save the basic information of the file to the database.
     *
     * @param workspaceId
     * @param file
     * @return
     */
    Integer saveFile(String workspaceId, FileUploadDTO file);
    Integer saveFile(String workspaceId, FileUploadDTO file) throws IOException, ImageProcessingException;
    void saveFiles(String workspaceId, FileUploadDTO file,File mediaFile);
//    void saveNailFile(String workspaceId, FileUploadDTO file) throws IOException, ImageProcessingException;
//    void saveZipFile(String workspaceId, FileUploadDTO file) throws IOException, ImageProcessingException;
    void updateNailMediaFileNames(String jobId);
    PaginationData<MediaFileEntity> getJobId( int pageNum, int pageSize,String workspaceId);
    PaginationData<MediaFileEntity> getPhotoByJobId(int page,int pageSize ,String workspaceId,String jobId);
    PaginationData<MediaFileEntity> mediaQuerys(Integer page, Integer pageSize, String workspaceId );
    /**
     * 获取媒体文件状态
     * @param fileId
     * @return
     */
    Object mediaInfo(String fileId);
    List<MediaFileEntity> getMedia(String jobId);
    /**
     * Query information about all files in this workspace based on the workspace id.
     *
     * @param workspaceId
     * @return
     */
    List<MediaFileDTO> getAllFilesByWorkspaceId(String workspaceId);
    void saveMarkFile(String workspaceId, FileUploadDTO files, File file1,String dkbh);
    PaginationData<MediaFileEntity> mediaQuery(Integer page, Integer pageSize, Long updateStart, Long updateEnd, Long photoStart, Long photoEnd, String jobName,String worksapceId,String isVedio,String jobId);
    PaginationData<MediaFileNailEntity> mediaNailQuery(Integer page, Integer pageSize, Long updateStart, Long updateEnd, Long photoStart, Long photoEnd, String jobName, String workspaceId, String type);
    /**
     * 获取图斑图片集合
     * @param dkbh
     * @param workspaceId
     * @return
     */
    List<MediaFileEntity> listByIsadd(String dkbh,String workspaceId);
    /**
     * 图斑图片审核状态改变
     * @param fileId
     * @return
     */
    ResponseResult updateExamByFileId(String fileId);
    List<MediaFileEntity> listMediaFileEntity(String workspaceId, String jobId);
    /**
     * Paginate through all media files in this workspace.
     *
     * @param workspaceId
     * @param page
     * @param pageSize
     * @return
     */
    PaginationData<MediaFileDTO> getMediaFilesPaginationByWorkspaceId(String workspaceId, long page, long pageSize);
    PaginationData<MediaFileEntity> getMediaFilesPaginationByWorkspaceId(String workspaceId, long page, long pageSize, MediaFileQueryParam mediaFileQueryParam);
    /**
     * Get the download address of the file.
     *
     * @param workspaceId
     * @param fileId
     * @return
     */
    URL getObjectUrl(String workspaceId, String fileId);
    ResponseResult downloadImages( List<String> jobIds);
    /**
     * Query all media files of a job.
     *
     * @param workspaceId
     * @param jobId
     * @return
     */
    List<MediaFileDTO> getFilesByWorkspaceAndJobId(String workspaceId, String jobId);
    List<String> getUniqueFilePaths(List<String> jobIds);
    /**
     * 更新文件
     *
     * @param workspaceId     项目id
     * @param mediaFileEntity
     * @return
     */
    Boolean updateMediaFile(String workspaceId, MediaFileEntity mediaFileEntity);
    int deleteMedia(String workspaceId, String fileId);
    void getNoaddFile();
}