package com.ff;

import com.ff.base.config.IdGeneratorUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootVersion;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;

/**
 * 启动程序
 *
 * @author ff
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@MapperScan({"com.ff.base.system.mapper","com.ff.quartz.mapper","com.ff.gen.mapper"})
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = DaoAuthenticationProvider.class)})
@EnableAsync
public class FFApplication implements CommandLineRunner
{
    @Autowired
    private IdGeneratorUtil idGeneratorUtil;


    public static void main(String[] args)
    {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(FFApplication.class, args);
        System.out.println("(♥◠‿◠)ﾉﾞ  FF启动成功   ლ(´ڡ`ლ)ﾞ"+ SpringBootVersion.getVersion());


    }

    @Override
    public void run(String... args) throws Exception {
        idGeneratorUtil.init();
    }
}
