package org.dromara.system.service;

import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.system.domain.bo.SysOssBo;
import org.dromara.system.domain.vo.SysOssUploadVo;
import org.dromara.system.domain.vo.SysOssVo;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.net.URL;
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);

    SysOssVo upload(File file);

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

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

    /**
     * pdf上传
     * @param file
     * @return
     */
    SysOssVo uploadPdf(MultipartFile file);

    /**
     * ppt上传
     * @param file
     * @return
     */
    SysOssVo uploadPPT(MultipartFile file);

    /**
     * 解析数据图片获取
     *
     * @param ossStr
     * @return
     */
    String generateTempUrl(String ossStr);


    /**
     * 文件预览地址获取
     *
     * @param ossId
     * @return
     */
    SysOssUploadVo previewDoc(Long ossId);
}
