package com.zcxk;


import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
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;


@Slf4j
@EnableDiscoveryClient
@SpringBootApplication
@EnableFeignClients
@EnableSwagger2
@EnableAsync
public class SmsWaterApplication {

    public static void main(String[] args) throws UnknownHostException {
        ApplicationContext context = SpringApplication.run(SmsWaterApplication.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 sms_water is running! Access URLs:\n\t" +
                "接口Doc: \t\thttp://" + ip + ":" + port + "/swagger-ui.html\n" +
                "----------------------------------------------------------");
    }

}
