ReportController.java 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.yaoyicloud.controller;
  2. import com.yaoyicloud.annotation.EasierLog;
  3. import com.yaoyicloud.dto.ReportDTO;
  4. import com.yaoyicloud.service.ReportService;
  5. import org.springframework.validation.annotation.Validated;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.RequestBody;
  8. import org.springframework.web.bind.annotation.RestController;
  9. import lombok.RequiredArgsConstructor;
  10. import lombok.extern.slf4j.Slf4j;
  11. import javax.servlet.http.HttpSession;
  12. import java.io.IOException;
  13. /**
  14. * 报告控制器
  15. *
  16. * @author snows
  17. * @date 2024/10/14
  18. */
  19. @RestController
  20. @RequiredArgsConstructor
  21. @Slf4j
  22. public class ReportController {
  23. private final ReportService reportService;
  24. /**
  25. * 创建Plus版本审核报告
  26. *
  27. * @param resource 请求参数
  28. * @return {@link Boolean } 结果
  29. */
  30. @EasierLog("创建Plus版本审核报告")
  31. @PostMapping("/report/create-report")
  32. public String createPlusVersionCheckReport(@Validated @RequestBody ReportDTO.OnCreatePlusVersionReport resource,
  33. HttpSession session) throws IOException {
  34. session.setAttribute(resource.getReportBastPath(), resource.getData());
  35. synchronized (this) {
  36. return reportService.createPlusVersionCheckReport(resource.getReportType(), resource.getData(),
  37. resource.getReportTempFile(), resource.getReportBastPath(), resource.getRelationId());
  38. }
  39. }
  40. }