package cn.novalon.gym.manage.app;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * 最小化应用程序启动类
 * 避免复杂的自动配置问题，专注于核心功能
 */
@SpringBootApplication(
    scanBasePackages = {
        "cn.novalon.gym.manage.app.config",
        "cn.novalon.gym.manage.app.controller",
        "cn.novalon.gym.manage.app.service"
    }
)
public class MinimalApplication {

    private static final Logger logger = LoggerFactory.getLogger(MinimalApplication.class);

    public static void main(String[] args) {
        logger.info("最小化应用程序启动中...");
        
        // 设置系统属性，避免自动配置问题
        System.setProperty("spring.autoconfigure.exclude", 
            "org.springframework.boot.autoconfigure.security.reactive.ReactiveUserDetailsServiceAutoConfiguration");
        
        // 禁用复杂的自动配置
        System.setProperty("spring.main.lazy-initialization", "true");
        System.setProperty("spring.main.banner-mode", "off");
        
        try {
            SpringApplication.run(MinimalApplication.class, args);
            logger.info("最小化应用程序启动完成");
        } catch (Exception e) {
            logger.error("应用程序启动失败: {}", e.getMessage());
            e.printStackTrace();
        }
    }
}