CommonController.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package com.fdkankan.manage.controller;
  2. import com.fdkankan.common.controller.BaseController;
  3. import com.fdkankan.common.response.ResultData;
  4. import com.fdkankan.manage.service.ICommonService;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RequestMethod;
  8. import org.springframework.web.bind.annotation.RequestParam;
  9. import org.springframework.web.bind.annotation.RestController;
  10. import org.springframework.web.multipart.MultipartFile;
  11. /**
  12. * <p>
  13. * TODO
  14. * </p>
  15. *
  16. * @author dengsixing
  17. * @since 2022/6/7
  18. **/
  19. @RestController
  20. @RequestMapping("/service/manage/common")
  21. public class CommonController extends BaseController {
  22. @Autowired
  23. private ICommonService commonService;
  24. /**
  25. * 文件上传
  26. * @param file 文件
  27. * @return
  28. * @throws Exception
  29. */
  30. @RequestMapping(value = "/upload/files", method = RequestMethod.POST)
  31. public ResultData uploads(
  32. @RequestParam(value = "file") MultipartFile file) throws Exception {
  33. return commonService.uploadFile(file);
  34. }
  35. }