Merge branch 'wn_robot_removedefaultquestion' into 0118
Showing
1 changed file
with
14 additions
and
16 deletions
@@ -14,7 +14,6 @@ import com.yoho.search.service.servicenew.IRobotQuestionService; | @@ -14,7 +14,6 @@ import com.yoho.search.service.servicenew.IRobotQuestionService; | ||
14 | import com.yoho.search.service.utils.HttpServletRequestUtils; | 14 | import com.yoho.search.service.utils.HttpServletRequestUtils; |
15 | import com.yoho.search.service.utils.SearchApiResultUtils; | 15 | import com.yoho.search.service.utils.SearchApiResultUtils; |
16 | import com.yoho.search.service.vo.SearchApiResult; | 16 | import com.yoho.search.service.vo.SearchApiResult; |
17 | -import org.apache.commons.collections.CollectionUtils; | ||
18 | import org.apache.commons.lang.StringUtils; | 17 | import org.apache.commons.lang.StringUtils; |
19 | import org.elasticsearch.index.query.BoolQueryBuilder; | 18 | import org.elasticsearch.index.query.BoolQueryBuilder; |
20 | import org.elasticsearch.index.query.MatchQueryBuilder; | 19 | import org.elasticsearch.index.query.MatchQueryBuilder; |
@@ -126,22 +125,21 @@ public class RobotQuestionServiceImpl extends BaseService implements IRobotQuest | @@ -126,22 +125,21 @@ public class RobotQuestionServiceImpl extends BaseService implements IRobotQuest | ||
126 | if (searchResult == null) { | 125 | if (searchResult == null) { |
127 | return searchApiResult.setCode(500); | 126 | return searchApiResult.setCode(500); |
128 | } | 127 | } |
129 | - | ||
130 | //8.如果结果为空,返回默认的一条结果 | 128 | //8.如果结果为空,返回默认的一条结果 |
131 | - if (CollectionUtils.isEmpty(searchResult.getResultList())) { | ||
132 | - JSONObject dataMap = new JSONObject(); | ||
133 | - dataMap.put("total", 1); | ||
134 | - dataMap.put("page", 1); | ||
135 | - dataMap.put("page_size", 1); | ||
136 | - dataMap.put("page_total", 1); | ||
137 | - Map<String, Object> productMap = new LinkedHashMap<>(); | ||
138 | - productMap.put("question", "default question"); | ||
139 | - productMap.put("answer", "我不太理解您的意思,您可以点击人工客服,联系我们萌萌哒客服妹纸处理问题哦~"); | ||
140 | - List<Map<String, Object>> pageList = new ArrayList<Map<String, Object>>(); | ||
141 | - pageList.add(productMap); | ||
142 | - dataMap.put("answer_list", pageList); | ||
143 | - return new SearchApiResult().setData(dataMap); | ||
144 | - } | 129 | +// if (CollectionUtils.isEmpty(searchResult.getResultList())) { |
130 | +// JSONObject dataMap = new JSONObject(); | ||
131 | +// dataMap.put("total", 1); | ||
132 | +// dataMap.put("page", 1); | ||
133 | +// dataMap.put("page_size", 1); | ||
134 | +// dataMap.put("page_total", 1); | ||
135 | +// Map<String, Object> productMap = new LinkedHashMap<>(); | ||
136 | +// productMap.put("question", "default question"); | ||
137 | +// productMap.put("answer", "我不太理解您的意思,您可以点击人工客服,联系我们萌萌哒客服妹纸处理问题哦~"); | ||
138 | +// List<Map<String, Object>> pageList = new ArrayList<Map<String, Object>>(); | ||
139 | +// pageList.add(productMap); | ||
140 | +// dataMap.put("answer_list", pageList); | ||
141 | +// return new SearchApiResult().setData(dataMap); | ||
142 | +// } | ||
145 | 143 | ||
146 | // 9.构造返回结果并加入缓存 | 144 | // 9.构造返回结果并加入缓存 |
147 | JSONObject dataMap = new JSONObject(); | 145 | JSONObject dataMap = new JSONObject(); |
-
Please register or login to post a comment