package com.sjyt.icom.asst;

import com.github.lianjiatech.retrofit.spring.boot.core.RetrofitScan;
import com.sjyt.icom.asst.server.NettyServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.net.UnknownHostException;

/**
 * @author Tab
 */
@Slf4j
@EnableScheduling
@SpringBootApplication
@RetrofitScan("com.sjyt.icom.asst.service.httpapi")
public class IComAsstApplication {

  public static void main(String[] args){
    try {
      ConfigurableApplicationContext application =
          SpringApplication.run(IComAsstApplication.class, args);
      NettyServer nettyServer = application.getBean(NettyServer.class);
      nettyServer.start();
    } catch (Throwable e) {
      e.printStackTrace();
    }
  }
}
