package com.lutao.cloud.common.security.annotation;

import com.lutao.cloud.common.security.component.CloudResourceServerAutoConfiguration;
import com.lutao.cloud.common.security.component.CloudSecurityBeanDefinitionRegistrar;
import org.springframework.context.annotation.Import;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;

import java.lang.annotation.*;

/**

 * @date 2018/11/10
 * <p>
 * 资源服务注解
 */
@Documented
@Inherited
@EnableResourceServer
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@EnableGlobalMethodSecurity(prePostEnabled = true)
@Import({ CloudResourceServerAutoConfiguration.class, CloudSecurityBeanDefinitionRegistrar.class })
public @interface EnableCloudResourceServer{

	/**
	 * 是否开启本地模式
	 * @return true
	 */
	boolean isLocal() default true;

}
