EnvironTask.java 914 B

12345678910111213141516171819202122232425262728293031323334
  1. package com.huimv.environ.task;
  2. import com.huimv.environ.client.EnvironClient;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.context.annotation.Configuration;
  5. import org.springframework.scheduling.annotation.EnableScheduling;
  6. import org.springframework.scheduling.annotation.Scheduled;
  7. import org.springframework.web.bind.annotation.RestController;
  8. import java.io.IOException;
  9. /**
  10. * @Project : huimv.shiwan
  11. * @Package : com.huimv.biosafety.uface.controller
  12. * @Description : TODO
  13. * @Version : 1.0
  14. * @Author : ZhuoNing
  15. * @Create : 2020-12-25
  16. **/
  17. @Configuration
  18. @EnableScheduling
  19. @RestController
  20. public class EnvironTask {
  21. @Autowired
  22. private EnvironClient environClient;
  23. // @Scheduled(cron = "0 0/60 * * * ?")
  24. @Scheduled(cron = "0/2 * * * * ?")
  25. private void sendEnviron() throws IOException {
  26. //
  27. environClient.send();
  28. }
  29. }