|
|
@@ -1,10 +1,10 @@
|
|
|
package com.uas.platform.b2c.common.search.rpc.service.Impl;
|
|
|
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2c.common.search.constant.SearchUrl;
|
|
|
import com.uas.platform.b2c.common.search.rpc.service.SearchService;
|
|
|
import com.uas.platform.b2c.core.utils.FastjsonUtils;
|
|
|
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
import com.uas.search.exception.SearchException;
|
|
|
import com.uas.search.model.CollectField;
|
|
|
import com.uas.search.model.PageParams;
|
|
|
@@ -15,7 +15,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
@@ -106,7 +105,9 @@ public class SearchServiceImpl implements SearchService{
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> getComponentIds(String keyword, PageParams var2) throws SearchException {
|
|
|
- Map<String, Object> map = initSearchMap(keyword, var2.getPage(), var2.getSize());
|
|
|
+ Map<String, Object> map = new HashedMap();
|
|
|
+ map.put("keyword", keyword);
|
|
|
+ map.put("params", FlexJsonUtils.toJsonDeep(var2));
|
|
|
String str = restTemplate.getForObject(SearchUrl.COMPONENT_ID_URL, String.class, map);
|
|
|
if(StringUtils.isEmpty(str)) {
|
|
|
return null;
|
|
|
@@ -331,18 +332,7 @@ public class SearchServiceImpl implements SearchService{
|
|
|
public Map<String, Object> getGoodsIds(String keyword, PageParams var2) throws SearchException {
|
|
|
Map<String, Object> map = new HashedMap();
|
|
|
map.put("keyword", keyword);
|
|
|
- map.put("page", var2.getPage());
|
|
|
- map.put("size", var2.getSize());
|
|
|
- if(var2.getFilters() == null) {
|
|
|
- map.put("filters", new JSONObject());
|
|
|
- }else {
|
|
|
- map.put("filters", FastjsonUtils.toJson(var2.getFilters()));
|
|
|
- }
|
|
|
- if(var2.getSort() == null) {
|
|
|
- map.put("sort", new ArrayList<>());
|
|
|
- }else {
|
|
|
- map.put("sort", FastjsonUtils.toJson(var2.getSort()));
|
|
|
- }
|
|
|
+ map.put("params", FlexJsonUtils.toJsonDeep(var2));
|
|
|
String str = restTemplate.getForObject(SearchUrl.GOODIS_URL, String.class, map);
|
|
|
if(StringUtils.isEmpty(str)) {
|
|
|
return null;
|