package com.sptg.device.biz;

import com.codingapi.txlcn.tc.config.EnableDistributedTransaction;
import com.github.tobato.fastdfs.FdfsClientConfig;
import com.sptg.ad.api.stream.AdvertTaskCallbackProduceInterface;
import com.sptg.device.biz.stream.DeviceAddProduceInterface;
import com.sptg.estate.api.stream.NoticeTaskCallbackProduceInterface;
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 org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * title: DeviceApplication
 * package: com.sptg.device.biz
 * description: 设备服务启动类
 *
 *
 */
@Slf4j
@SpringCloudApplication
@EnableAsync
@EnableScheduling
@EnableEurekaClient
@EnableFeignClients(basePackages = {
        "com.sptg.permissions.api.feigns",
        "com.sptg.statistics.api.feigns",
        "com.sptg.estate.api.feigns",
        "com.sptg.third.api.feigns"
})
@ComponentScan(basePackages = {
        "com.sptg.device.biz",
        "com.sptg.permissions.api.feigns",
        "com.sptg.statistics.api.feigns",
        "com.sptg.estate.api.feigns",
        "com.sptg.third.api.feigns"
})
@EnableDistributedTransaction
@Import(FdfsClientConfig.class)
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
@EnableBinding(value = {
        DeviceAddProduceInterface.class,
        AdvertTaskCallbackProduceInterface.class,
        NoticeTaskCallbackProduceInterface.class
})
public class DeviceApplication {

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


}
