From dc5be7d38446f70e6ff86df311119c32b41fe7f8 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 28 十一月 2020 16:37:05 +0800 Subject: [PATCH] 大淘客搜索接口升级 --- fanli/src/main/java/com/yeshi/fanli/service/impl/config/HotSearchServiceImpl.java | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/config/HotSearchServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/config/HotSearchServiceImpl.java index 3d28ecd..0dbe9ae 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/config/HotSearchServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/config/HotSearchServiceImpl.java @@ -5,7 +5,9 @@ import javax.annotation.Resource; +import com.yeshi.fanli.entity.SystemEnum; import org.apache.commons.beanutils.PropertyUtils; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import com.yeshi.fanli.dao.mybatis.goods.HotSearchMapper; @@ -54,9 +56,9 @@ @Override - public List<HotSearch> listQuery(int start, int count, String key, Long systemId, Integer useType) throws Exception { + public List<HotSearch> listQuery(int start, int count, String key, Long systemId, Integer useType, SystemEnum system) throws Exception { - List<HotSearch> listObj = hotSearchMapper.listQuery(start, count, key, systemId, useType); + List<HotSearch> listObj = hotSearchMapper.listQuery(start, count, key, systemId, useType,system); if (listObj == null || listObj.size() == 0) { return null; @@ -97,10 +99,10 @@ for (SuperHotSearch superHotSearch : listSuper) { HotSearch search = superHotSearch.getHotSearch(); - BusinessSystem system = superHotSearch.getSystem(); + BusinessSystem s = superHotSearch.getSystem(); // 褰撳墠涓撻 銆佸綋鍓嶇郴缁� - if (search != null && system != null && id == search.getId() && superSystemId == system.getId()) { + if (search != null && system != null && id == search.getId() && superSystemId == s.getId()) { newsystem.setCheck(1); break; } @@ -120,8 +122,17 @@ } @Override - public int countList(String key, Long systemId, Integer useType) { - return hotSearchMapper.countQuery(key, systemId, useType); + public int countList(String key, Long systemId, Integer useType, SystemEnum system) { + return hotSearchMapper.countQuery(key, systemId, useType,system); } + + @Override + @Cacheable(value = "crgCache", key = "'getHotSearchCache-' + #useType+'-'+#system") + public List<HotSearch> getHotSearchCache(Integer useType, SystemEnum system) { + return hotSearchMapper.getHotSearchList(useType,system); + } + + + } -- Gitblit v1.8.0