CommonController.java 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package com.fdkankan.manage.controller;
  2. import com.fdkankan.manage.common.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. */
  27. @RequestMapping(value = "/upload/files", method = RequestMethod.POST)
  28. public ResultData uploads(
  29. @RequestParam(value = "file") MultipartFile file) throws Exception {
  30. return commonService.uploadFile(file);
  31. }
  32. /**
  33. * 文件上传
  34. * @param file 文件
  35. */
  36. @RequestMapping(value = "/upload/fileNew", method = RequestMethod.POST)
  37. public ResultData uploadNew(
  38. @RequestParam(value = "file") MultipartFile file,@RequestParam(value = "dictId") Integer dictId) {
  39. return commonService.uploadFileNew(file,dictId);
  40. }
  41. }