mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
[fix] String类型判断使用StringUtils.isNotEmpty() 而不是Objects.isNull()
This commit is contained in:
@@ -7,9 +7,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||
@@ -34,6 +34,6 @@ public class CursorPageBaseReq {
|
||||
|
||||
@JsonIgnore
|
||||
public Boolean isFirstPage() {
|
||||
return Objects.isNull(cursor);
|
||||
return StringUtils.isNotEmpty(cursor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ import com.auth0.jwt.interfaces.Claim;
|
||||
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||
import com.auth0.jwt.interfaces.JWTVerifier;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
@@ -59,7 +59,7 @@ public class JwtUtils {
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Claim> verifyToken(String token) {
|
||||
if (Objects.isNull(token)) {
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.abin.mallchat.common.common.utils.FutureUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jsoup.Connection;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
@@ -38,7 +39,7 @@ public abstract class AbstractUrlTitleDiscover implements UrlTitleDiscover {
|
||||
//并行请求
|
||||
List<CompletableFuture<Pair<String, String>>> futures = matchList.stream().map(match -> CompletableFuture.supplyAsync(() -> {
|
||||
String title = getUrlTitle(match);
|
||||
return Objects.nonNull(title) ? Pair.of(match, title) : null;
|
||||
return StringUtils.isNotEmpty(title) ? Pair.of(match, title) : null;
|
||||
})).collect(Collectors.toList());
|
||||
CompletableFuture<List<Pair<String, String>>> future = FutureUtils.sequenceNonNull(futures);
|
||||
//结果组装
|
||||
|
||||
Reference in New Issue
Block a user