package com.sptg.gateway;

import com.github.tobato.fastdfs.FdfsClientConfig;
import com.sptg.common.core.locale.I18Config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.context.annotation.Import;
import org.springframework.jmx.support.RegistrationPolicy;

/**
 * title: DeviceGatewayApplication
 * package: com.sptg.gateway
 * description: app网关启动类
 *
 *
 *
 */
@Slf4j
@SpringBootApplication
@EnableHystrix
@EnableEurekaClient
@EnableFeignClients(basePackages = {
        "com.sptg.permissions.api.feigns",
        "com.sptg.estate.api.feigns",
        "com.sptg.device.api.feigns",
        "com.sptg.statistics.api.feigns",
        "com.sptg.ad.api.feigns",
        "com.sptg.pay.api.feigns",
        "com.sptg.iot.api.feigns",
        "com.sptg.video.cloud.api.feigns"
})
@ComponentScan(value = {
        "com.sptg.gateway",
        "com.sptg.permissions.api.feigns",
        "com.sptg.estate.api.feigns",
        "com.sptg.device.api.feigns",
        "com.sptg.statistics.api.feigns",
        "com.sptg.ad.api.feigns",
        "com.sptg.pay.api.feigns",
        "com.sptg.iot.api.feigns",
        "com.sptg.video.cloud.api.feigns"
})
@Import({FdfsClientConfig.class,I18Config.class})
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
public class GridGatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(GridGatewayApplication.class,args);
        log.warn("启动完成");
    }

}
