using System;
using System.Collections.Generic;
using Infrastructure;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using OpenAuth.App;
using OpenAuth.App.Interface;
using OpenAuth.Repository.Domain;
namespace OpenAuth.Mvc.Controllers
{
/// 文件上传
/// yubaolee, 2019-03-08.
public class FilesController : BaseController
{
private FileApp _app;
public FilesController(IAuth authUtil, FileApp app) : base(authUtil)
{
_app = app;
}
///
/// 批量上传文件接口
///
///
/// 服务器存储的文件信息
[HttpPost]
public Response> Upload(IFormFileCollection files)
{
var result = new Response>();
try
{
result.Result = _app.Add(files);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.Message;
}
return result;
}
}
}