AttachmentService.java 1.26 KB
package isa.qa.service;

import isa.qa.dto.response.AttachmentResponseDTO;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 *  Attachment service
 *
 *  @author    May
 *  @date      2018/12/28 16:09
 *  @version   1.0
 */
public interface AttachmentService {

    /**
     * Upload a file
     *
     * @param accessKey client application access key
     * @param file uploaded file
     * @return attachment info
     */
    AttachmentResponseDTO uploadFile(String accessKey, MultipartFile file) throws IOException;

    /**
     * Upload files
     *
     * @param accessKey client application access key
     * @param files uploaded file list
     * @return attachment list's info
     */
    List<AttachmentResponseDTO> uploadFiles(String accessKey, List<MultipartFile> files) throws IOException;

    /**
     * Delete the file by unique filename
     *
     * @param accessKey access key
     * @param fileName unique file name
     * @return delete result
     */
    boolean deleteFile(String accessKey, String fileName);

    /**
     * Delete the file by unique filename(Admin manager api)
     *
     * @param fileName unique file name
     * @return delete result
     */
    boolean deleteFile(String fileName);
}