Merge pull request #11 from hakusai22/main

[fix] 修改了一些CollectionUtil.isEmpty()/Objects.equals()判断
This commit is contained in:
zongzibinbin
2023-06-03 01:23:45 +08:00
committed by GitHub
6 changed files with 11 additions and 8 deletions

View File

@@ -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));
}
}

View File

@@ -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());