CommonController.java 1.0 KB

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