DemoController.java 941 B

1234567891011121314151617181920212223242526272829303132
  1. package com.yihu.jw.controller;
  2. import com.yihu.jw.config.quartz.QuartzHelper;
  3. import com.yihu.jw.restmodel.common.Envelop;
  4. import org.quartz.SchedulerException;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.scheduling.quartz.SchedulerFactoryBean;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.RequestParam;
  9. import org.springframework.web.bind.annotation.RestController;
  10. import java.util.HashMap;
  11. import java.util.List;
  12. import java.util.Map;
  13. /**
  14. * Created by chenweida on 2017/11/3.
  15. */
  16. @RestController
  17. public class DemoController {
  18. @Autowired
  19. SchedulerFactoryBean schedulerFactoryBean;
  20. @Autowired
  21. private QuartzHelper quartzHelper;
  22. @GetMapping("demo")
  23. public String demo() throws Exception {
  24. System.out.println(schedulerFactoryBean.getScheduler().getSchedulerName());
  25. return "123";
  26. }
  27. }