From d1f26741bddf6f512d62c0100d42c52be8d37e76 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 06 二月 2021 15:35:40 +0800
Subject: [PATCH] 工具类优化

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/user/HistorySearchServiceImpl.java |   57 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 29 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..b156bcb 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,29 @@
-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 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) {
+		searchKey = searchKey != null && searchKey.length() > 64 ? searchKey.substring(0, 64) : searchKey;
+		HistorySearch historySearch = new HistorySearch();
+		historySearch.setName(searchKey);
+		historySearch.setBusinessId(bid);
+		historySearch.setCreatetime(new Date());
+		historySearch.setState(0);
+		historySearchMapper.insertSelective(historySearch);
+	}
+
+}

--
Gitblit v1.8.0