核查系统api
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

  1. package com.iflytop.nuclear.controller;
  2. import com.iflytop.nuclear.entity.CheckInfo;
  3. import com.iflytop.nuclear.entity.CheckResult;
  4. import com.iflytop.nuclear.service.CheckService;
  5. import com.iflytop.nuclear.utils.ResponseData;
  6. import lombok.extern.slf4j.Slf4j;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.*;
  9. /**
  10. * @author cool
  11. * @date 2023/7/2 09:41
  12. */
  13. @Slf4j
  14. @RestController
  15. @CrossOrigin
  16. @RequestMapping("/check")
  17. public class CheckController {
  18. @Autowired
  19. CheckService checkService;
  20. @GetMapping("/auto/{id}")
  21. public ResponseData checkAuto(@PathVariable(name = "id") int taskId) {
  22. CheckInfo checkInfo = checkService.getCheckInfoByTaskId(taskId);
  23. int order = checkInfo.getOrder();
  24. String startIndex = checkInfo.getCurrentCoord();
  25. int status = checkInfo.getStatus();
  26. if (status == 3) {
  27. // 已经完成
  28. return ResponseData.fail("该任务已经完成,无法自动检测");
  29. }
  30. // 判断当前order 0为横向检查 1为纵向检查
  31. CheckResult checkResult = checkService.autoCheck(order, startIndex, taskId);
  32. return ResponseData.success();
  33. }
  34. }