From c7935647594b0aa0092945b07963e9cc82b09b5d Mon Sep 17 00:00:00 2001 From: qinyujie <943868899@qq.com> Date: Tue, 20 Feb 2024 00:35:43 +0800 Subject: [PATCH] 3.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 增加多种JsonHttpMessageConverter的支持 --- .../gracefulresponse/advice/NotVoidResponseBodyAdvice.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/feiniaojin/gracefulresponse/advice/NotVoidResponseBodyAdvice.java b/src/main/java/com/feiniaojin/gracefulresponse/advice/NotVoidResponseBodyAdvice.java index 49eef4a..3ab4997 100644 --- a/src/main/java/com/feiniaojin/gracefulresponse/advice/NotVoidResponseBodyAdvice.java +++ b/src/main/java/com/feiniaojin/gracefulresponse/advice/NotVoidResponseBodyAdvice.java @@ -62,8 +62,9 @@ public boolean supports(MethodParameter methodParameter, //method为空、返回值为void、非JSON,直接跳过 if (Objects.isNull(method) || method.getReturnType().equals(Void.TYPE) + || method.getReturnType().equals(Response.class) || !isJsonHttpMessageConverter(clazz)) { - logger.debug("Graceful Response:method为空、返回值为void、非JSON,跳过"); + logger.debug("Graceful Response:method为空、返回值为void和Response类型、非JSON,跳过"); return false; }