package gaf3.core.gateway.bean

import gaf3.core.gateway.filter.factory.*
import gaf3.core.gateway.handler.predicate.JwtRoutePredicateFactory
import gaf3.core.services.verify.service.VerifyCodeService
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

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

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

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

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

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

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

    @Bean
    fun verifyCodeGatewayFilterFactory(service: VerifyCodeService): VerifyCodeGatewayFilterFactory {
        return VerifyCodeGatewayFilterFactory(service)
    }

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

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

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