package org.sky.gateway.config;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.sky.gateway.filter.GatewayFilter;
import org.sky.gateway.props.AuthProperties;
import org.sky.gateway.props.RequestProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.server.WebFilter;

/**
 * 路由配置信息
 *
 * @author Chill
 */
@Slf4j
@Configuration(proxyBeanMethods = false)
@AllArgsConstructor
@EnableConfigurationProperties({AuthProperties.class, RequestProperties.class})
public class RouterFunctionConfiguration {

	/**
	 * 全局配置
	 */
	@Bean
	public WebFilter gatewayFilter(RequestProperties requestProperties) {
		return new GatewayFilter(requestProperties);
	}

}
