From 77a30459cdc7b6a0c3a8254716a1903e893fb9f6 Mon Sep 17 00:00:00 2001 From: lifenlong Date: Wed, 4 Aug 2021 09:27:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/application.yml | 2 +- .../search/serviceimpl/EsGoodsSearchServiceImpl.java | 6 +++--- .../serviceimpl/VerificationSourceServiceImpl.java | 11 +++++------ .../controller/other/ElasticsearchController.java | 4 ---- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/config/application.yml b/config/application.yml index b3516405..f3d8b6bb 100644 --- a/config/application.yml +++ b/config/application.yml @@ -74,7 +74,7 @@ spring: default-datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.0.116:3306/lanshan?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai + url: jdbc:mysql://192.168.0.116:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai username: root password: lilishop maxActive: 20 diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java index 2ad41f23..1da832ea 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java @@ -104,12 +104,12 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService { @Override public List getHotWords(Integer count) { List hotWords = new ArrayList<>(); - if (hotWords.isEmpty() || hotWords == null) { - return null; - } //下表从0开始,所以count-1 count = count - 1; Set set = cache.reverseRangeWithScores(CachePrefix.HOT_WORD.getPrefix(), count); + if (set.isEmpty() || set == null) { + return null; + } for (DefaultTypedTuple defaultTypedTuple : set) { hotWords.add(Objects.requireNonNull(defaultTypedTuple.getValue()).toString()); } diff --git a/framework/src/main/java/cn/lili/modules/system/serviceimpl/VerificationSourceServiceImpl.java b/framework/src/main/java/cn/lili/modules/system/serviceimpl/VerificationSourceServiceImpl.java index 329823ba..9ffb5915 100644 --- a/framework/src/main/java/cn/lili/modules/system/serviceimpl/VerificationSourceServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/system/serviceimpl/VerificationSourceServiceImpl.java @@ -48,11 +48,10 @@ public class VerificationSourceServiceImpl extends ServiceImpl