GateServiceApplication.java 1010 B

123456789101112131415161718192021222324252627282930
  1. package com.greentech.gateservice;
  2. import org.springframework.boot.SpringApplication;
  3. import org.springframework.boot.autoconfigure.SpringBootApplication;
  4. import org.springframework.scheduling.annotation.EnableScheduling;
  5. import redis.clients.jedis.JedisPool;
  6. import com.greentech.gateservice.service.*;
  7. import com.greentech.gateservice.controller.CameraController;
  8. import com.greentech.gateservice.redis.SubThread;
  9. @SpringBootApplication
  10. @EnableScheduling
  11. public class GateServiceApplication {
  12. private static final JedisPool jedisPool = new JedisPool("47.96.12.136", 6379);
  13. public static void main(String[] args) {
  14. boolean ok = CameraController.init(new CameraDisConnect(jedisPool), new CameraReConnect(jedisPool));
  15. if (!ok) {
  16. System.out.println("dahua sdk init fail");
  17. System.exit(1);
  18. }
  19. SubThread subThread = new SubThread(jedisPool);
  20. subThread.start();
  21. SpringApplication.run(GateServiceApplication.class, args);
  22. }
  23. }