package com.inspect.ivs.init;

import com.inspect.ivs.service.IvsLoginService;
import com.inspect.ivs.util.WebClientUtils;
import java.io.IOException;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class InitIvs {
   private static final Logger log = LoggerFactory.getLogger(InitIvs.class);
   @Autowired
   private IvsLoginService loginService;
   @Value("${ivs.test:false}")
   private Boolean test;

   @PostConstruct
   public void init() {
      if(!this.test.booleanValue()) {
         this.loginService.run();
      }

      try {
         WebClientUtils.refreshDomains();
      } catch (IOException var2) {
         log.error("=============SSL域名加载失败！{}", var2.getMessage());
      }

   }
}
