package com.cloudhandson.ddsbackoffice;

import com.cloudhandson.ddsbackoffice.config.DdsProperties;
import com.cloudhandson.ddsbackoffice.config.DdsMcpIamProperties;
import com.cloudhandson.vpdbackoffice.VpdBackofficeApplication;
import com.cloudhandson.vpdbackoffice.web.DashboardController;
import com.cloudhandson.vpdbackoffice.web.LoginController;
import com.cloudhandson.vpdbackoffice.web.VectorKnowledgeController;
import com.cloudhandson.vpdbackoffice.web.VpdPolicyController;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

@SpringBootApplication
@EnableConfigurationProperties({DdsProperties.class, DdsMcpIamProperties.class})
@MapperScan("com.cloudhandson.vpdbackoffice.mapper")
@ComponentScan(
    basePackages = {"com.cloudhandson.ddsbackoffice", "com.cloudhandson.vpdbackoffice"},
    excludeFilters = @ComponentScan.Filter(
        type = FilterType.ASSIGNABLE_TYPE,
        classes = {
            DdsBackofficeApplication.class,
            VpdBackofficeApplication.class,
            com.cloudhandson.ddsbackoffice.config.AppConfig.class,
            com.cloudhandson.vpdbackoffice.config.SecurityConfig.class,
            DashboardController.class,
            LoginController.class,
            VectorKnowledgeController.class,
            VpdPolicyController.class
        }
    )
)
public class DdsBackofficeApplication {

  public static void main(String[] args) {
    SpringApplication.run(DdsBackofficeApplication.class, args);
  }
}
