diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java index 135f76a..ab910e2 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java @@ -1,6 +1,7 @@ package com.chaozhanggui.system.cashierservice.controller; +import cn.hutool.extra.servlet.ServletUtil; import com.alibaba.fastjson.JSON; import com.chaozhanggui.system.cashierservice.service.OrderService; import com.chaozhanggui.system.cashierservice.sign.CodeEnum; @@ -8,6 +9,7 @@ import com.chaozhanggui.system.cashierservice.sign.Result; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.Map; @@ -25,11 +27,12 @@ public class NotifyController { } @RequestMapping("notifyPay") - public String notifyPay(@RequestParam Map map){ - log.info("notifyPay:{}", JSON.toJSONString(map)); - log.error("notifyPay:{}", JSON.toJSONString(map)); - log.debug("notifyPay:{}", JSON.toJSONString(map)); - log.warn("notifyPay:{}", JSON.toJSONString(map)); + public String notifyPay(HttpServletRequest request,@RequestParam Map map){ + log.info("request ip:{}", request.getRemoteAddr()); + Map params = ServletUtil.getParams(request); + String body = ServletUtil.getBody(request); + log.info("notifyPay params:{}", JSON.toJSONString(params)); + log.info("notifyPay body:{}", body); return null; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomFilter.java b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomFilter.java index 969c1e9..0cdd811 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomFilter.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomFilter.java @@ -1,7 +1,5 @@ package com.chaozhanggui.system.cashierservice.interceptor; -import cn.hutool.extra.servlet.ServletUtil; -import com.alibaba.fastjson.JSON; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -9,7 +7,6 @@ import javax.servlet.*; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletRequest; import java.io.IOException; -import java.util.Map; @Slf4j @Component @@ -23,10 +20,6 @@ public class CustomFilter implements Filter { @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { log.info(">>>> customFilter doFilter start <<<<"); - log.info("request ip:{}", servletRequest.getRemoteAddr()); - Map params = ServletUtil.getParams(servletRequest); - log.info("request params:{}", params); - log.info("request params:{}", JSON.toJSONString(params)); RequestWrapper requestWapper = null; if (servletRequest instanceof HttpServletRequest) { requestWapper = new RequestWrapper((HttpServletRequest) servletRequest); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/SignInterceptor.java b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/SignInterceptor.java index 12b8d3e..a908a8a 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/SignInterceptor.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/SignInterceptor.java @@ -49,6 +49,10 @@ public class SignInterceptor implements HandlerInterceptor { return true; } + if (requestUri.contains("/notify/notifyPay")) { + return true; + } + if (requestUri.contains("/notify/cancel")) { return true; }