/*-------------------------------------------------------------------------
 * 功能描述：UploadService
 * 作者：xulisong
 * 创建时间： 2019/7/30 10:44:23
 * 版本号：v1.0
 *  -------------------------------------------------------------------------*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MBIRevitBase.Config;
using MBIRevitBase.Tools;

namespace MBIRevitBase.Services
{
    /// <summary>
    /// 上传服务类
    /// </summary>
    public class UploadService
    {
        /// <summary>
        /// 上传导出文件
        /// </summary>
        /// <param name="result"></param>
        /// <returns></returns>
        public static BResult UploadExportFile(string result)
        {
            var stream = ZipUtils.ZipString(result, "export.json");
            var url = ApiConfig.AlgorithmUrl() + @"/upload-json-zip/upload";
            return HttpUtils.PostFormDataFile(url, stream);
        }
    }
}
