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

com.jxrisesun.framework.cloud.gateway.route.CaptchaRouter Maven / Gradle / Ivy

package com.jxrisesun.framework.cloud.gateway.route;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.server.RequestPredicates;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;

import com.jxrisesun.framework.cloud.gateway.handler.ValidateCodeHandler;

@Configuration
public class CaptchaRouter {

	@Autowired
	private ValidateCodeHandler validateCodeHandler;
	
	@SuppressWarnings("rawtypes")
	@Bean
	public RouterFunction routerFunction() {
		return RouterFunctions.route(RequestPredicates.GET("/code").and(RequestPredicates.accept(MediaType.TEXT_PLAIN)),
				validateCodeHandler);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy