using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Request.App.OftenContact;
using GxPress.Result;
using GxPress.Result.App.OftenContact;

namespace GxPress.Service.Interface.Storage
{
    public interface IStorage
    {
        /// <summary>
        ///     保存文件
        /// </summary>
        /// <param name="path">文件保存路径</param>
        /// <param name="bytes">文件二进制数据</param>
        /// <returns>保存文件是否成功！</returns>
        void Save(string path, byte[] bytes);

        /// <summary>
        ///     保存文件
        /// </summary>
        /// <param name="path">文件保存路径</param>
        /// <param name="fileName">文件名</param>
        /// <param name="bytes">文件二进制数据</param>
        /// <returns>保存后文件的路径，为空时，表示上传不成功！</returns>
        PathResult SaveFile(string path, string fileName, byte[] bytes);

        /// <summary>
        /// 获取保存的路径
        /// </summary>
        /// <param name="path"></param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        PathResult GetSavePath(string path,string fileName);

        /// <summary>
        /// 获取图片保存地址
        /// </summary>
        /// <param name="path"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        PathResult SaveQRCodeFile(string path, string content);

        /// <summary>
        ///     删除指定的文件
        /// </summary>
        /// <param name="path">文件路径</param>
        /// <returns>删除是否成功</returns>
        bool Delete(string path);

        /// <summary>
        ///     判断文件是否存在
        /// </summary>
        /// <param name="path">文件路径</param>
        /// <returns>是否存在</returns>
        bool Exists(string path);

        /// <summary>
        ///     读取文件
        /// </summary>
        /// <param name="path">文件路径</param>
        /// <returns>文件的二进制数据</returns>
        byte[] Read(string path);
    }

    
}
