package ink.wgink.module.file.dao;


import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.init.IInitBaseTable;
import ink.wgink.module.file.pojo.dtos.FileDTO;
import ink.wgink.module.file.pojo.dtos.FileInfoDTO;
import ink.wgink.pojo.pos.FilePO;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: IFileDao
 * @Description: 文件
 * @Author: wenc
 * @Date: 2019/1/3 4:36 PM
 * @Version: 1.0
 **/
@Repository
public interface IFileDao extends IInitBaseTable {

    /**
     * 保存文件
     *
     * @param params
     * @throws SaveException
     */
    void save(Map<String, Object> params) throws SaveException;


    /**
     * 删除文件
     *
     * @param params
     * @throws RemoveException
     */
    void remove(Map<String, Object> params) throws RemoveException;

    /**
     * 删除文件(物理删除)
     *
     * @param params
     * @throws RemoveException
     */
    void delete(Map<String, Object> params) throws RemoveException;

    /**
     * 修改文件
     *
     * @param params
     * @throws UpdateException
     */
    void update(Map<String, Object> params) throws UpdateException;

    /**
     * 更新文件描述
     *
     * @param fileParams
     * @throws SearchException
     */
    void updateSummary(Map<String, Object> fileParams) throws SearchException;

    /**
     * 获取文件详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    FilePO getPO(Map<String, Object> params) throws SearchException;

    /**
     * 获取文件列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<FileDTO> list(Map<String, Object> params) throws SearchException;

    /**
     * 获取文件列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<FileInfoDTO> listInfo(Map<String, Object> params) throws SearchException;

    /**
     * 文件列表
     *
     * @param fileMd5 文件MD5值
     * @return
     * @throws SearchException
     */
    List<FileInfoDTO> listByMd5(String fileMd5) throws SearchException;

    /**
     * 文件列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<FilePO> listPO(Map<String, Object> params) throws SearchException;

}
