using ASHermed.SinoInterface.Api.ContractModel.Framework.File;
using ASHermed.SinoInterface.Api.IService.File.v1;
using ASHermed.SinoInterface.ContractModel;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ASHermed.SinoInterface.WebApi.Controllers.File.v1
{
    /// <summary>
    /// 文件
    /// 创建人：杨江军
    /// 创建时间：2021/1/8/星期五 15:22:27
    /// </summary>
    [Route("api/v1/[controller]")]
    [ApiVersion("1.0")]
    [ApiController]
    public class FileController : BaseController
    {
        #region 初始化

        /// <summary>
        /// 文件管理服务
        /// </summary>
        private readonly IFileManageService fileManageService;

        /// <summary>
        /// 默认构造函数
        /// </summary>
        public FileController(IFileManageService _fileManageService)
        {
            fileManageService = _fileManageService;
        } 

        #endregion

        /// <summary>
        /// 文件上传
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("Upload")]
        public Task<BaseResponse<UploadFileForClientModel>> UploadFile([FromForm]UploadFileForForClientParam param)
        {
            return fileManageService.UploadFile(param);
        }
    }
}
