From 6e27ca4ca752fa008d11384c80ad7ae6186fcda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Sat, 26 Aug 2023 14:17:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=BF=87=E6=BB=A4=E5=99=A8=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springbootkwan/filter/TimeFilter.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/main/java/com/kwan/springbootkwan/filter/TimeFilter.java diff --git a/src/main/java/com/kwan/springbootkwan/filter/TimeFilter.java b/src/main/java/com/kwan/springbootkwan/filter/TimeFilter.java new file mode 100644 index 0000000..fd8064e --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/filter/TimeFilter.java @@ -0,0 +1,25 @@ +package com.kwan.springbootkwan.filter; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import java.io.IOException; + +@Slf4j +@Component +@Order(1) +public class TimeFilter implements Filter { + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + log.info("先执行:接口执行时间"); + chain.doFilter(request, response); + } +} + -- GitLab