package com.zcloud.zcGbsServicer;

import com.jjb.saas.framework.auth.config.EnableAuthClient;
import com.jjb.saas.framework.feign.annotation.EnableJjbFeignClients;
import com.jjb.saas.gateway.starter.annotation.EnableGatewayServer;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.core.annotation.AliasFor;
import org.springframework.jmx.support.RegistrationPolicy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;

import java.lang.annotation.*;

/**
 * @author lin
 */
@Configuration(proxyBeanMethods = true)
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
@EnableAspectJAutoProxy
@EnableDiscoveryClient
@EnableAuthClient
@EnableScheduling
@EnableAsync
@EnableGlobalMethodSecurity(prePostEnabled = true)
@EnableCaching
@EnableJjbFeignClients
@MapperScan
@ComponentScan
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@EnableGatewayServer
@SpringBootApplication
public @interface ZcloudSpringbootApplication {
    @AliasFor(annotation = ComponentScan.class, attribute = "basePackages") String[] scanBasePackages() default {"com.jjb"};

    @AliasFor(annotation = MapperScan.class, attribute = "basePackages") String[] mapperPackages() default {"com.jjb.*.*.infrastructure.persistence.mapper"};
}
