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.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.ad.api.stream.SyncFaceAdvertDataProduceInterface;
import com.sptg.ad.api.stream.SyncLeisureAdvertDataProduceInterface;
import com.sptg.common.core.locale.I18Config;
import com.sptg.estate.api.stream.SyncNoticeDataDeviceProduceInterface;

/**
 * title: DeviceGatewayApplication
 * package: com.sptg.gateway
 * description: 设备网关启动类
 *
 *
 *
 */
@Slf4j
@EnableFeignClients(basePackages = {
        "com.sptg.device.api.feigns",
        "com.sptg.estate.api.feigns",
        "com.sptg.statistics.api.feigns",
        "com.sptg.ad.api.feigns",
        "com.sptg.permissions.api.feigns",
        "com.sptg.iot.api.feigns",
        "com.sptg.third.api.feigns",
        "com.sptg.video.cloud.api.feigns"
})
@EnableEurekaClient
@ComponentScan(value = {
        "com.sptg.gateway",
        "com.sptg.device.api.feigns",
        "com.sptg.estate.api.feigns",
        "com.sptg.statistics.api.feigns",
        "com.sptg.ad.api.feigns",
        "com.sptg.permissions.api.feigns",
        "com.sptg.iot.api.feigns",
        "com.sptg.third.api.feigns",
        "com.sptg.video.cloud.api.feigns"
})
@SpringCloudApplication
@Import({FdfsClientConfig.class,I18Config.class})
@EnableBinding(value = {
        SyncFaceAdvertDataProduceInterface.class,
        SyncLeisureAdvertDataProduceInterface.class,
        SyncNoticeDataDeviceProduceInterface.class
})
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
public class DeviceGatewayApplication {

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

}
