From 26d9ec6a6ccfac35a2d2efa95ba75657d7689633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Thu, 10 Oct 2024 14:40:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=B5=8B=E8=AF=95=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E6=94=AF=E4=BB=98=E6=88=90=E5=8A=9F=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/controller/NotifyController.java | 5 ++++- .../system/cashierservice/interceptor/CustomFilter.java | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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 16647b9..135f76a 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java @@ -25,8 +25,11 @@ public class NotifyController { } @RequestMapping("notifyPay") - public String notifyPay(@RequestBody Map map){ + 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)); 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 0cdd811..969c1e9 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomFilter.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomFilter.java @@ -1,5 +1,7 @@ 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; @@ -7,6 +9,7 @@ import javax.servlet.*; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletRequest; import java.io.IOException; +import java.util.Map; @Slf4j @Component @@ -20,6 +23,10 @@ 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);