Search in sources :

Example 1 with VxApiRouteHandlerParamCheck

use of com.szmirren.vxApi.core.handler.route.VxApiRouteHandlerParamCheck in project VX-API-Gateway by EliMirren.

the class VxApiApplication method initParamCheck.

/**
 * 初始化参数检查
 *
 * @param api
 * @param route
 */
public void initParamCheck(VxApis api, Route route) {
    route.path(api.getPath());
    if (api.getMethod() != HttpMethodEnum.ALL) {
        route.method(HttpMethod.valueOf(api.getMethod().getVal()));
    }
    // 添加consumes
    if (api.getConsumes() != null) {
        api.getConsumes().forEach(va -> route.consumes(va));
    }
    VxApiRouteHandlerParamCheck paramCheckHandler = VxApiRouteHandlerParamCheck.create(api);
    route.handler(paramCheckHandler);
}
Also used : VxApiRouteHandlerParamCheck(com.szmirren.vxApi.core.handler.route.VxApiRouteHandlerParamCheck)

Aggregations

VxApiRouteHandlerParamCheck (com.szmirren.vxApi.core.handler.route.VxApiRouteHandlerParamCheck)1