FileConvertController.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package com.fdkankan.scene.controller;
  2. import com.fdkankan.common.response.ResultData;
  3. import com.fdkankan.scene.service.IFileConvertService;
  4. import com.fdkankan.web.controller.BaseController;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  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/5/17
  18. **/
  19. @RestController
  20. @RequestMapping("/service/common/convert")
  21. public class FileConvertController extends BaseController {
  22. @Autowired
  23. private IFileConvertService fileConvertService;
  24. /**
  25. * <p>
  26. txt转modeldata
  27. * </p>
  28. * @author dengsixing
  29. * @date 2022/7/1
  30. * @param file
  31. * @return com.fdkankan.common.response.ResultData
  32. **/
  33. @PostMapping("/convertTxtToModeldata")
  34. public ResultData convertTxtToModeldata(@RequestParam("file") MultipartFile file) throws Exception{
  35. fileConvertService.convertTxtToModeldata(file, this.response);
  36. return ResultData.ok();
  37. }
  38. /**
  39. * <p>
  40. txt转dam
  41. * </p>
  42. * @author dengsixing
  43. * @date 2022/7/1
  44. * @param file
  45. **/
  46. @PostMapping("/convertTxtToDam")
  47. public void convertTxtToDam(@RequestParam("file") MultipartFile file) throws Exception{
  48. fileConvertService.convertTxtToDam(file, this.response);
  49. }
  50. /**
  51. * <p>
  52. txt转lzma
  53. * </p>
  54. * @author dengsixing
  55. * @date 2022/7/1
  56. * @param file
  57. **/
  58. @PostMapping("/convertTxtToLzma")
  59. public void convertTxtToLzma(@RequestParam("file") MultipartFile file) throws Exception{
  60. fileConvertService.convertTxtToLzma(file, this.response);
  61. }
  62. }