using System;
using System.Threading.Tasks;
using Abp.Application.Services;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace YGNT.File.Application.File
{
    public interface IFileAppService : IApplicationService
    {
        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="formFile"></param>
        /// <param name="md5">md5值用于检测当前文件是否已经上传过(可以不传)</param>
        /// <returns></returns>
        Task<Guid> Upload(IFormFile formFile, string md5);

        /// <summary>
        /// 上传图片(图片最大不超过10m)
        /// </summary>
        /// <param name="formFile"></param>
        /// <param name="md5"></param>
        /// <returns></returns>
        Task<string> UploadImgAsync(IFormFile formFile, string md5);

        /// <summary>
        /// 读取文件
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<object> ReadFile(Guid id);
    }
}