package com.persagy.dmp.file.service;

import com.alibaba.fastjson.JSONObject;

import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import java.util.Set;

/***
 * Description: 向前兼容文件服务接口
 * @author : lijie
 * Update By lijie 2021/12/8 14:27
 */
public interface CompatibleOldFileService {
    /***
     * Description: 上传文件
     * @param inputStream : 文件流
     * @author : lijie
     * Update By lijie 2021/12/8 14:29
     */
    void uploadFile(InputStream inputStream);
    /***
     * Description: 下载文件
     * @param response : 响应参数
     * @author : lijie
     * Update By lijie 2021/12/8 17:06
     */
    void getFile(HttpServletResponse response);
    /***
     * Description: 列出文件key
     * @param param : 请求参数
     * @return : void
     * @author : lijie
     * Update By lijie 2021/12/8 18:22
     */
    List<String> listFiles(JSONObject param);
    /***
     * Description: 上传工单的文件
     * @param inputStream : 文件流
     * @author : lijie
     * Update By lijie 2021/12/9 10:07
     */
    void uploadWorkOrderFile(InputStream inputStream);
    /***
     * Description: 下载工单文件
     * @param response : 响应体
     * @author : lijie
     * Update By lijie 2021/12/9 11:06
     */
    void getWorkOrderFile(HttpServletResponse response);
    /***
     * Description: 根据key删除文件
     * @param deleteKeys : 删除key
     * @return : java.util.List<java.lang.String>
     * @author : lijie
     * Update By lijie 2021/12/9 11:31
     */
    Set<String> deleteFileByIds(List<String> deleteKeys);
    /***
     * Description: 更改文件key
     * @param from : 旧文件key
     * @param to : 新文件key
     * @return : java.lang.Boolean
     * @author : lijie
     * Update By 2021/12/9 17:05
     */
    Boolean fileKeyChange(String from, String to);
    /***
     * Description: 断点续传之注册上传id
     * @return : java.lang.String
     * @author : lijie
     * Update By 2021/12/9 19:39
     */
    String registerMultipartUpload();
    /***
     * Description: 通用的文件上传逻辑
     * @param inputStream : 文件流
     * @return : java.lang.String
     * @author : lijie
     * Update By lijie 2021/12/9 10:17
     */
    void commonUploadFile(InputStream inputStream, String bucketName, String businessId);
}
