...
|
...
|
@@ -6,6 +6,7 @@ import com.yoho.search.recall.scene.component.*; |
|
|
import com.yoho.search.recall.scene.models.*;
|
|
|
import com.yoho.search.recall.scene.persional.PersionalFactor;
|
|
|
import com.yoho.search.recall.scene.persional.RecallPersionalService;
|
|
|
import com.yoho.search.service.helper.SearchCommonHelper;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
...
|
...
|
@@ -32,6 +33,8 @@ public class SceneRecallService { |
|
|
private BatchResponseBuilder batchResponseBuilder;
|
|
|
@Autowired
|
|
|
private RecallResultBuilder recallResultBuilder;
|
|
|
@Autowired
|
|
|
private SearchCommonHelper searchCommonHelper;
|
|
|
|
|
|
public SearchApiResult sceneRecall(Map<String, String> paramMap) {
|
|
|
try {
|
...
|
...
|
@@ -50,13 +53,12 @@ public class SceneRecallService { |
|
|
//TODO
|
|
|
//5、构造返回结果
|
|
|
JSONObject dataMap = new JSONObject();
|
|
|
dataMap.put("recallResult",recallResult);
|
|
|
// dataMap.put("total", recallResult.getTotal());
|
|
|
// dataMap.put("page", recallResult.getPage());
|
|
|
// dataMap.put("page_size", recallResult.getPageSize());
|
|
|
// dataMap.put("page_total", recallResult.getRecallPageTotal());
|
|
|
// dataMap.put("product_list", recallResult.getSknList());
|
|
|
// return new SearchApiResult().setData(dataMap);
|
|
|
dataMap.put("total", recallResult.getTotal());
|
|
|
dataMap.put("page", recallParams.getPage());
|
|
|
dataMap.put("page_size", recallParams.getPageSize());
|
|
|
dataMap.put("page_total", searchCommonHelper.getTotalPage(recallResult.getTotal(),recallParams.getPageSize()));
|
|
|
dataMap.put("product_list",recallResult);
|
|
|
return new SearchApiResult().setData(dataMap);
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage(), e);
|
|
|
return new SearchApiResult().setData(null).setCode(500).setMessage("Exception");
|
...
|
...
|
|