Authored by Gino Zhang

suggestTips接口返回分页信息

@@ -376,8 +376,14 @@ public class SuggestServiceImpl implements ISuggestService, ApplicationEventPubl @@ -376,8 +376,14 @@ public class SuggestServiceImpl implements ISuggestService, ApplicationEventPubl
376 } 376 }
377 377
378 // 3) 返回结果 378 // 3) 返回结果
  379 + Map<String, Object> dataMap = new HashMap<>();
  380 + dataMap.put("total", searchResult.getTotal());
  381 + dataMap.put("page", searchResult.getPage());
  382 + dataMap.put("page_size", searchParam.getSize());
  383 + dataMap.put("page_total", searchResult.getTotalPage());
  384 + dataMap.put("conversion_list", searchResult.getResultList());
379 logger.info("[func=suggestConversion][cost={}]", System.currentTimeMillis() - begin); 385 logger.info("[func=suggestConversion][cost={}]", System.currentTimeMillis() - begin);
380 - return new SearchApiResult().setData(searchResult.getResultList()); 386 + return new SearchApiResult().setData(dataMap);
381 } catch (Exception e) { 387 } catch (Exception e) {
382 logger.error(e.getMessage(), e); 388 logger.error(e.getMessage(), e);
383 return new SearchApiResult().setCode(500).setMessage(e.getMessage()).setData(null); 389 return new SearchApiResult().setCode(500).setMessage(e.getMessage()).setData(null);