UploadController.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using Microsoft.AspNetCore.Mvc;
  2. using Common;
  3. using Services;
  4. using Infrastructure;
  5. namespace Controllers.Client
  6. {
  7. /// <summary>
  8. /// User)Controller
  9. /// </summary>
  10. // [ApiExplorerSettings(GroupName = "User")]
  11. public class UploadController : BaseController
  12. {
  13. private readonly IUploadService _UploadService;
  14. public UploadController(IUploadService UploadService)
  15. {
  16. _UploadService = UploadService;
  17. }
  18. /// <summary>
  19. /// 用户基本信息
  20. /// </summary>
  21. /// <param name="param">参数请求体</param>
  22. /// <returns>用户基本信息</returns>
  23. [HttpPut]
  24. [Route("/v1/omega_upload/uploadfile")]
  25. public IActionResult uploadFile(IFormFile file)
  26. {
  27. string path = _UploadService.getPicPath(file);
  28. Dictionary<string, string> obj = new();
  29. var option = App.OptionsSetting;
  30. obj.Add("uploadUrl", option.Upload.UploadUrl + path);
  31. obj.Add("saveUrl", path);
  32. return SUCCESS(obj);
  33. }
  34. }
  35. }