Commit 0355653d by xub

商品查询

parent 2fe81b25
......@@ -21,7 +21,7 @@ public class GoodsCategoryController {
private CategoryApiService categoryApiSerivce;
/**
* @Description: 查询所有(一级分组
* @Description: 查询所有(一级类目
* @author xub
*/
@GetMapping("list-parent-category")
......@@ -36,7 +36,7 @@ public class GoodsCategoryController {
}
/**
* @Description: 查询所有(二级分组
* @Description: 查询所有(二级类目
* @author xub
*/
@GetMapping("list-child-category")
......
package com.gic.plug.web.controller.goods;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.goods.api.dto.ErrorCode;
import com.gic.goods.api.dto.GoodsTagDTO;
import com.gic.goods.api.service.TagApiService;
import com.gic.plug.web.vo.goods.GoodsTagVO;
import com.gic.search.business.api.dto.DynamicSearchDTO;
import com.gic.search.business.api.dto.ESResponseQueryBatchDTO;
import com.gic.search.business.api.service.EsBusinessManageApiService;
import com.gic.search.business.api.service.EsBusinessOperaApiService;
import com.gic.search.business.api.utils.NewNodeAddUtil;
import com.gic.widget.screening.api.service.EsScreeningSearchService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @ClassName: GoodsTagController
* @Description: 商品标签相关接口
* @author xub
* @date 2019/8/29 上午10:03
*/
@RestController
public class GoodsController {
@Autowired
private EsBusinessOperaApiService esBusinessOperaApiService;
@Autowired
private EsScreeningSearchService esScreeningSearchService;
/**
* @Description: 查询所有(不分页)
* @author xub
*/
@GetMapping("list-goods")
public RestResponse findList(@RequestParam(value = "currentPage", defaultValue = "1") Integer currentPage,
@RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize, Long goodsDomainId,String goodsCode) {
DynamicSearchDTO searchDTO = new DynamicSearchDTO();
String esName = esScreeningSearchService.getCurrentEsName("goods-test-123456", "goods-search");
searchDTO.setIndexName(esName);
searchDTO.setColumnCategoryCode("goods-search");
searchDTO.setEnterpriseId("goods-test-123456");
searchDTO.setType("mapper_type");
searchDTO.setBegin(currentPage);
searchDTO.setRecordNumber(pageSize);
JSONObject jsonObject = new JSONObject();
jsonObject.put("goodsCode", goodsCode);
jsonObject.put("goodsDomainId", goodsDomainId);
searchDTO.setSearchJson(jsonObject);
ServiceResponse<ESResponseQueryBatchDTO> serviceResponse = esBusinessOperaApiService.queryDataBatch(searchDTO, false, null);
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
}
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
}
......@@ -42,7 +42,13 @@
<dubbo:reference interface="com.gic.goods.api.service.PropertyApiService" id="propertyApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.goods.api.service.BrandApiService" id="brandApiService" timeout="60000" retries="0" />
<!-- -->
<dubbo:reference id="tagApiService" interface="com.gic.goods.api.service.TagApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference id="cordApiService" interface="com.gic.goods.api.service.CordApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference id="tagApiService" interface="com.gic.goods.api.service.TagApiService" timeout="60000" retries="0" check="false"/>
<dubbo:reference id="cordApiService" interface="com.gic.goods.api.service.CordApiService" timeout="60000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.search.business.api.service.EsBusinessOperaApiService" id="esBusinessOperaApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.search.business.api.service.EsBusinessManageApiService" id="esBusinessManageApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.widget.screening.api.service.EsScreeningSearchService" id="esScreeningSearchService" timeout="60000" retries="0" />
</beans>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment