package com.zd.forward;

import com.zd.common.core.constant.Constants;
import com.zd.common.core.properties.SnowflakeProperties;
import com.zd.common.security.annotation.EnableCustomConfig;
import com.zd.common.security.annotation.EnableRyFeignClients;
import com.zd.forward.config.AlgorithmYml;
import com.zd.forward.properties.FireProperties;
import com.zd.forward.serivce.LoginService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;
import springfox.documentation.oas.annotations.EnableOpenApi;
import zd.common.mqtt.config.MqttProperties;

/**
 * @author Administrator
 */
@EnableCustomConfig
@EnableRyFeignClients
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class},scanBasePackages = {Constants.BASE_PACKAGE})
@EnableConfigurationProperties({MqttProperties.class, FireProperties.class, SnowflakeProperties.class, AlgorithmYml.class})
@EnableOpenApi
public class ForwardApp {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(ForwardApp.class, args);
        //获取token
        LoginService bean = run.getBeanFactory().getBean(LoginService.class);
        bean.loginLab();
        System.out.println("(♥◠‿◠)ﾉﾞ 转发服务启动！ ლ(´ڡ`ლ)ﾞ");
    }
}
