package com.dsk.system.service;

import com.dsk.oss.entity.UploadResult;
import com.dsk.system.domain.bo.SysOssBo;
import com.dsk.system.domain.vo.SysOssVo;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.List;

/**
 * 文件上传 服务层
 *
 * @author Lion Li
 */
public interface ISysOssService {

    TableDataInfo<SysOssVo> queryPageList(SysOssBo sysOss, PageQuery pageQuery);

    List<SysOssVo> listByIds(Collection<Long> ossIds);

    SysOssVo getById(Long ossId);

    SysOssVo upload(MultipartFile file) throws UnsupportedEncodingException;

    SysOssVo upload(File file);

    SysOssVo buildResultEntity(String originalfileName, String suffix, String configKey, UploadResult uploadResult);

    void download(Long ossId, HttpServletResponse response) throws IOException;

    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    InputStream downFileIO(Long ossId);

}
