|  |  |  | 
|---|
|  |  |  | package com.doumee.core.annotation.pr; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.constants.ResponseStatus; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.BeansException; | 
|---|
|  |  |  | 
|---|
|  |  |  | // 获取验证对象和方法 | 
|---|
|  |  |  | PreventRepeatAdapter adapter = (PreventRepeatAdapter)applicationContext.getBean(prAnnotation.value()); | 
|---|
|  |  |  | // 验证暴力请求 | 
|---|
|  |  |  | if(prAnnotation.limit() > 0 && prAnnotation.lockTime() > 0 && adapter.massive(request, prAnnotation.limit(), prAnnotation.lockTime())) { | 
|---|
|  |  |  | if(prAnnotation.limit() > 0 && prAnnotation.lockTime() > 0 | 
|---|
|  |  |  | && adapter.massive(request, prAnnotation.limit(), prAnnotation.lockTime())) { | 
|---|
|  |  |  | log.warn("Eva Intercept a massive request,url:{}", request.getRequestURI()); | 
|---|
|  |  |  | response.setHeader("content-type", "application/json;charset=UTF-8"); | 
|---|
|  |  |  | ApiResponse apiResponse = ApiResponse.failed(ResponseStatus.MASSIVE_REQUEST); | 
|---|