mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-15 23:23:43 +08:00
[fix] 修改了一些CollectionUtil.isEmpty()/Objects.equals()判断
This commit is contained in:
@@ -24,6 +24,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
@@ -72,7 +73,7 @@ public class SwaggerConfig {
|
||||
}
|
||||
|
||||
private boolean shouldRegisterLinksMapping(WebEndpointProperties webEndpointProperties, Environment environment, String basePath) {
|
||||
return webEndpointProperties.getDiscovery().isEnabled() && (StringUtils.hasText(basePath) || ManagementPortType.get(environment).equals(ManagementPortType.DIFFERENT));
|
||||
return webEndpointProperties.getDiscovery().isEnabled() && (StringUtils.hasText(basePath) || Objects.equals(ManagementPortType.get(environment), ManagementPortType.DIFFERENT));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.abin.mallchat.custom.common.intecepter;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.abin.mallchat.common.common.domain.dto.RequestInfo;
|
||||
import com.abin.mallchat.common.common.exception.HttpErrorEnum;
|
||||
import com.abin.mallchat.common.common.utils.RequestHolder;
|
||||
@@ -44,7 +45,7 @@ public class BlackInterceptor implements HandlerInterceptor {
|
||||
}
|
||||
|
||||
private boolean inBlackList(Object target, Set<String> blackSet) {
|
||||
if (Objects.isNull(target) || Objects.isNull(blackSet)) {
|
||||
if (Objects.isNull(target) || CollectionUtil.isEmpty(blackSet)) {
|
||||
return false;
|
||||
}
|
||||
return blackSet.contains(target.toString());
|
||||
|
||||
Reference in New Issue
Block a user