FileConvertController.java 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package com.fdkankan.scene.controller;
  2. import com.fdkankan.scene.service.IFileConvertService;
  3. import com.fdkankan.web.controller.BaseController;
  4. import com.fdkankan.web.response.ResultData;
  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/scene/common/convert")
  21. public class FileConvertController extends BaseController {
  22. @Autowired
  23. private IFileConvertService fileConvertService;
  24. /**
  25. * <p>
  26. TODO
  27. * </p>
  28. * @author dengsixing
  29. * @date 2022/8/1
  30. * @param file
  31. * @return com.fdkankan.web.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. TODO
  41. * </p>
  42. * @author dengsixing
  43. * @date 2022/8/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. TODO
  53. * </p>
  54. * @author dengsixing
  55. * @date 2022/8/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. /**
  63. * <p>
  64. TODO
  65. * </p>
  66. * @author dengsixing
  67. * @date 2022/8/1
  68. * @param file
  69. **/
  70. @PostMapping("/convertDamToTxt")
  71. public void convertDamToTxt(@RequestParam("file") MultipartFile file) throws Exception{
  72. fileConvertService.convertDamToTxt(file, this.response);
  73. }
  74. }