package cclotus.cloud.gateway.bean

import gaf3.core.gateway.GatewayController
import gaf3.core.gateway.filter.factory.*
import gaf3.core.gateway.handler.predicate.JwtRoutePredicateFactory
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
open class FactoryBean {
    @Bean
    open fun setRequestHeaderExGatewayFilterFactory(): SetRequestHeaderExGatewayFilterFactory {
        return SetRequestHeaderExGatewayFilterFactory()
    }

    @Bean
    open fun jwtParserGatewayFilterFactory(): JwtParserGatewayFilterFactory {
        return JwtParserGatewayFilterFactory()
    }

    @Bean
    open fun hostToTenantGatewayFilterFactory(): HostToTenantGatewayFilterFactory {
        return HostToTenantGatewayFilterFactory()
    }

    @Bean
    open fun weixinTokenGatewayFilterFactory(): WeixinTokenGatewayFilterFactory {
        return WeixinTokenGatewayFilterFactory()
    }

    @Bean
    open fun setRequestParameterGatewayFilterFactory(): SetRequestParameterGatewayFilterFactory {
        return SetRequestParameterGatewayFilterFactory()
    }

    @Bean
    open fun forwardGatewayFilterFactory(): ForwardGatewayFilterFactory {
        return ForwardGatewayFilterFactory()
    }

    @Bean
    open fun jwtRoutePredicateFactory(): JwtRoutePredicateFactory {
        return JwtRoutePredicateFactory()
    }

    @Bean
    open fun peekResGatewayFilterFactory(): PeekResponseBodyGatewayFilterFactory {
        return PeekResponseBodyGatewayFilterFactory()
    }

    @Bean
    open fun peekReqGatewayFilterFactory(): PeekRequestBodyGatewayFilterFactory {
        return PeekRequestBodyGatewayFilterFactory()
    }

    @Bean
    open fun gatewayController(): GatewayController {
        return GatewayController()
    }
}