package com.zcxk.rmcp.web;


import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author Andy
 * @version V1.0
 **/
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages="com.zcxk")
@EnableSwagger2
@MapperScan("com.zcxk.rmcp.core.dao")
@Slf4j
@EnableAsync
public class ZoniotRmcpApplication {

    public static void main(String[] args) throws UnknownHostException {
        ApplicationContext context = SpringApplication.run(ZoniotRmcpApplication.class, args);
        context.getApplicationName();
        Environment env = context.getEnvironment();
        String ip = InetAddress.getLocalHost().getHostAddress();
        String port = env.getProperty("server.port");
        log.info("\n----------------------------------------------------------\n\t" +
                "Application zoniot-rmcp-web is running! Access URLs:\n\t" +
                "接口Doc: \t\thttp://" + ip + ":" + port + "/swagger-ui.html\n" +
                "----------------------------------------------------------");
    }

}
