All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.gateway.GatewayConfig.ftl Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
package ${packageName}.gateway.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import ${packageName}.gateway.filter.RequestGlobalFilter;
import ${packageName}.gateway.handler.GlobalExceptionHandler;

/***
 * 网关配置
 *
 * @author Co.
 * @date: 2022/10/15 11:19
 * @return
 */

@Configuration
public class GatewayConfig {

    @Value("${r'${yesaiot.request-legal-time:0}'}")
    private long requestLegalTimes;

    @Bean
    public RequestGlobalFilter requestGlobalFilter() {
        return new RequestGlobalFilter(requestLegalTimes);
    }

    @Bean
    public GlobalExceptionHandler globalExceptionHandler(ObjectMapper objectMapper) {
        return new GlobalExceptionHandler(objectMapper);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy