package com.sptg.gateway;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.context.annotation.Import;
import org.springframework.jmx.support.RegistrationPolicy;

import com.github.tobato.fastdfs.FdfsClientConfig;
import com.sptg.common.core.locale.I18Config;
import com.sptg.device.api.stream.DeviceDeleteProduceInterface;
import com.sptg.device.api.stream.DeviceUpdateProduceInterface;

/**
 * title: HouseGatewayApplication
 * package: com.sptg.gateway
 * description: 智汇管家平台网关-启动类
 *
 *
 *
 */
@Slf4j
@EnableHystrixDashboard
@SpringCloudApplication
@EnableFeignClients(basePackages = {
        "com.sptg.device.api.feigns",
        "com.sptg.permissions.api.feigns",
        "com.sptg.estate.api.feigns",
        "com.sptg.ad.api.feigns",
        "com.sptg.statistics.api.feigns",
        "com.sptg.pay.api.feigns",
        "com.sptg.video.cloud.api.feigns",
        "com.sptg.iot.api.feigns",
        "com.sptg.third.api.feigns"
})
@ComponentScan(value = {
        "com.sptg.gateway",
        "com.sptg.permissions.api.feigns",
        "com.sptg.estate.api.feigns",
        "com.sptg.ad.api.feigns",
        "com.sptg.device.api.feigns",
        "com.sptg.statistics.api.feigns",
        "com.sptg.pay.api.feigns",
        "com.sptg.video.cloud.api.feigns",
        "com.sptg.iot.api.feigns",
        "com.sptg.third.api.feigns"
})
@Import({FdfsClientConfig.class,I18Config.class})
@EnableEurekaClient
@EnableBinding(value = { DeviceUpdateProduceInterface.class, DeviceDeleteProduceInterface.class })
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
public class HouseGatewayApplication {

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


}
