XxlJobController.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.tzld.supply.controller;
  2. import com.tzld.supply.common.base.CommonResponse;
  3. import com.tzld.supply.job.ContentScreenJob;
  4. import com.tzld.supply.job.SpiderJob;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RestController;
  9. @RestController
  10. @RequestMapping("/job")
  11. public class XxlJobController {
  12. @Autowired
  13. private SpiderJob spiderJob;
  14. @Autowired
  15. private ContentScreenJob contentScreenJob;
  16. @GetMapping("/spiderTaskJob")
  17. public CommonResponse<Void> spiderTaskJob() {
  18. spiderJob.spiderTaskJob(null);
  19. return CommonResponse.success();
  20. }
  21. @GetMapping("/searchContentDetailJob")
  22. public CommonResponse<Void> searchContentDetailJob() {
  23. spiderJob.searchContentDetailJob(null);
  24. return CommonResponse.success();
  25. }
  26. @GetMapping("/contentRoughScreenJob")
  27. public CommonResponse<Void> contentRoughScreenJob() {
  28. contentScreenJob.contentRoughScreenJob(null);
  29. return CommonResponse.success();
  30. }
  31. @GetMapping("/contentPrecisionScreenJob")
  32. public CommonResponse<Void> contentPrecisionScreenJob() {
  33. contentScreenJob.contentPrecisionScreenJob(null);
  34. return CommonResponse.success();
  35. }
  36. }