rain
2024-07-22 43b6292b4b2810560bbf2d22c96bd44c11d4160b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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.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.IOException;
import java.net.URL;
import java.util.List;
 
/**
 * @author sean
 * @version 0.2
 * @date 2021/12/9
 */
public interface IFileService {
 
    /**
     * Query if the file already exists based on the workspace id and the fingerprint of the file.
     *
     * @param workspaceId
     * @param fingerprint
     * @return
     */
    Boolean checkExist(String workspaceId, String fingerprint);
 
    /**
     * Save the basic information of the file to the database.
     *
     * @param workspaceId
     * @param file
     * @return
     */
    Integer saveFile(String workspaceId, FileUploadDTO file) throws IOException, ImageProcessingException;
 
    /**
     * 存储水印图片
     * @param workspaceId
     * @param file
     * @throws IOException
     * @throws FontFormatException
     * @throws ImageProcessingException
     */
    void saveMarkFile(String workspaceId, FileUploadDTO file) throws IOException, FontFormatException, ImageProcessingException;
    void updateMarkMediaFileNames(String jobId);
    PaginationData<MediaFileEntity> getJobId( int pageNum, int pageSize,String workspaceId);
    PaginationData<MediaFileEntity> getPhotoByJobId(int page,int pageSize ,String workspaceId,String jobId);
 
    /**
     * 获取媒体文件状态
     * @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);
 
    PaginationData<MediaFileEntity> mediaQuery(Integer page, Integer pageSize, Long updateStart, Long updateEnd, Long photoStart, Long photoEnd, String jobName,String worksapceId,String isVedio);
 
    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<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);
}