package ink.wgink.module.file.media.service;

import org.springframework.web.multipart.MultipartFile;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IMediaService
 * @Description: 媒体
 * @Author: WangGeng
 * @Date: 2021/6/9 21:32
 * @Version: 1.0
 **/
public interface IMediaService {

    /**
     * 读取流大小 1M
     */
    int INPUT_STREAM_SIZE = 1048576;

    /**
     * 单文件上传
     *
     * @param multipartFile 上传文件
     * @param uploadPath    上传的文件路径
     * @param uploadName    上传的文件名称
     * @return 文件MD5
     */
    String upload(MultipartFile multipartFile, String uploadPath, String uploadName);

    /**
     * 获得ContentType
     *
     * @param fileType
     * @return ContentType
     */
    String getContentType(String fileType);

    /**
     * 得到文件名称
     *
     * @param fileName
     * @return
     */
    String getFileType(String fileName);

}
