Commit a49e220f authored by 黎博's avatar 黎博

bug fix

parent f5c902c9
......@@ -47,6 +47,22 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
String uri = request.getRequestURI();
// 多订单白名单mock
if (uri.equals("/ex/isInWhiteList")) {
Map<String, Object> whiteListResult = new HashMap<>();
if (xyqbIsInWhiteList.equals("true")) {
whiteListResult.put("code", 0);
whiteListResult.put("businessCode", "0000");
whiteListResult.put("msg", "命中");
} else if (xyqbIsInWhiteList.equals("false")) {
whiteListResult.put("code", 0);
whiteListResult.put("businessCode", "0001");
whiteListResult.put("msg", "未命中");
}
whiteListResult.put("body", null);
InterceptorUtils.constructResponse(response, JSON.toJSONString(whiteListResult), "application/json; charset=utf-8");
return false;
}
Map<String, String[]> parameterMap = request.getParameterMap();
Map<String, Object> requestMap = convertParameterMap(parameterMap);
QueryWrapper<Mock> queryWrapper = new QueryWrapper<>();
......@@ -67,22 +83,6 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
InterceptorUtils.constructResponse(response, JSON.toJSONString(responseMap), "application/json; charset=utf-8");
return false;
}
// 多订单白名单mock
if (uri.equals("/ex/isInWhiteList")) {
Map<String, Object> whiteListResult = new HashMap<>();
if (xyqbIsInWhiteList.equals("true")) {
whiteListResult.put("code", 0);
whiteListResult.put("businessCode", "0000");
whiteListResult.put("msg", "命中");
} else if (xyqbIsInWhiteList.equals("false")) {
whiteListResult.put("code", 0);
whiteListResult.put("businessCode", "0001");
whiteListResult.put("msg", "未命中");
}
whiteListResult.put("body", null);
InterceptorUtils.constructResponse(response, JSON.toJSONString(whiteListResult), "application/json; charset=utf-8");
return false;
}
log.info("{}的mock响应为:{}", uri, mockData);
InterceptorUtils.constructResponse(response, mockData, "application/json; charset=utf-8");
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment