From 5e7b0ed4a154ad067cbcf4aa1a1c7cce32f9864c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 26 四月 2024 18:02:17 +0800 Subject: [PATCH] 唯品会链接解析升级 --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/HistorySearchServiceImpl.java | 56 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 28 insertions(+), 28 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/HistorySearchServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/HistorySearchServiceImpl.java index c20ad55..e3eea45 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/HistorySearchServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/HistorySearchServiceImpl.java @@ -1,28 +1,28 @@ -package com.yeshi.fanli.service.impl.user; - -import java.util.Date; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.yeshi.fanli.dao.mybatis.HistorySearchMapper; -import com.yeshi.fanli.entity.bus.search.HistorySearch; -import com.yeshi.fanli.service.inter.user.HistorySearchService; - -@Service -public class HistorySearchServiceImpl implements HistorySearchService { - - @Resource - private HistorySearchMapper historySearchMapper; - - public void addHistorySearch(String searchKey, String bid) { - HistorySearch historySearch = new HistorySearch(); - historySearch.setName(searchKey); - historySearch.setBusinessId(bid); - historySearch.setCreatetime(new Date()); - historySearch.setState(0); - historySearchMapper.insertSelective(historySearch); - } - -} +package com.yeshi.fanli.service.impl.user; + +import com.yeshi.fanli.dao.user.HistorySearchDao; +import com.yeshi.fanli.entity.bus.search.HistorySearch; +import com.yeshi.fanli.service.inter.user.HistorySearchService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.UUID; + +@Service +public class HistorySearchServiceImpl implements HistorySearchService { + + @Resource + private HistorySearchDao historySearchDao; + + public void addHistorySearch(HistorySearch search) { + if (search.getId() == null) { + search.setId(UUID.randomUUID().toString()); + } + if (search.getCreatetime() == null) { + search.setCreatetime(new Date()); + } + historySearchDao.save(search); + } + +} -- Gitblit v1.8.0