package com.fs;

import com.fs.core.config.WxMpConfiguration;
import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 启动程序（精简为服务号静默授权）
 * <p>
 * 排除 fs-common 中可能存在的 RedisConfig（打包 jar 版本），以及 fs-service 的 WxMpConfiguration；
 * 改用本模块 framework Redis 与 mp-silent 公众号配置。
 * </p>
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@ComponentScan(
        basePackages = "com.fs",
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.REGEX, pattern = "com\\.fs\\.common\\.config\\.RedisConfig"),
                @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = WxMpConfiguration.class)
        }
)
@EnableTransactionManagement
@EnableSwaggerBootstrapUI
@EnableScheduling
@EnableAsync
@EnableCaching
public class FsUserAppApplication {

    public static void main(String[] args) {
        SpringApplication.run(FsUserAppApplication.class, args);
        System.out.println("fs-mp-app 启动成功");
    }
}
