
// 








namespace SafeCampus.Web.Core;

[ApiDescriptionSettings(Tag = "文件上传控制器")]
public class UploadController : BaseController
{
    private readonly IFileService _fileService;

    public UploadController(IFileService fileService)
    {
        _fileService = fileService;
    }

    /// <summary>1
    /// 上传图片
    /// </summary>
    /// <param name="file"></param>
    /// <returns></returns>
    [HttpPost("uploadImg")]
    [DisplayName("上传图片")]
    [DisableRequestSizeLimit]
    public async Task<long> UploadImg([FromForm] IFormFile file)
    {
        //先上传到本地,后面优化
        return await _fileService.UploadFile(SysDictConst.FILE_ENGINE_LOCAL, file);
    }
}
