|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
package com.supervision.config;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.supervision.domain.GlobalResult;
|
|
|
|
@ -31,7 +30,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
* @date 2022/3/10 13:24
|
|
|
|
|
*/
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RestControllerAdvice(annotations = RestController.class, basePackages = {"com.**.controller"})
|
|
|
|
|
@RestControllerAdvice(annotations = RestController.class, basePackages = {"com.supervision.**.controller"})
|
|
|
|
|
public class ResponseConfig implements ResponseBodyAdvice<Object> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -39,7 +38,14 @@ public class ResponseConfig implements ResponseBodyAdvice<Object> {
|
|
|
|
|
public boolean supports(@Nullable MethodParameter methodParameter,
|
|
|
|
|
@Nullable Class<? extends HttpMessageConverter<?>> aClass) {
|
|
|
|
|
assert methodParameter != null;
|
|
|
|
|
return !methodParameter.getDeclaringClass().getName().contains("swagger");
|
|
|
|
|
String lowerCase = methodParameter.getDeclaringClass().getName().toLowerCase();
|
|
|
|
|
log.info(lowerCase);
|
|
|
|
|
if (lowerCase.contains("swagger") || lowerCase.contains("springdoc")) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
log.info("--------{}---------", lowerCase);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|