|
|
|
@ -2,52 +2,55 @@ package com.ms.api.spi.move;
|
|
|
|
|
|
|
|
|
|
import com.doudian.open.api.product_isv_getClueList.ProductIsvGetClueListRequest;
|
|
|
|
|
import com.doudian.open.api.product_isv_getClueList.ProductIsvGetClueListResponse;
|
|
|
|
|
import com.doudian.open.api.product_isv_getClueList.data.ProductIsvGetClueListData;
|
|
|
|
|
import com.doudian.open.api.product_isv_getClueList.param.ProductIsvGetClueListParam;
|
|
|
|
|
import com.jinritemai.cloud.base.api.BaseRequest;
|
|
|
|
|
import com.jinritemai.cloud.base.api.BaseResponse;
|
|
|
|
|
import com.jinritemai.cloud.base.api.ExtensionService;
|
|
|
|
|
import com.jinritemai.cloud.base.api.ExtensionServiceHandler;
|
|
|
|
|
import com.ms.api.common.R;
|
|
|
|
|
import com.ms.api.common.Ret;
|
|
|
|
|
import com.ms.api.common.SPIBaseService;
|
|
|
|
|
import com.ms.api.dto.move.GetShopCloudHotProductsRequestDTO;
|
|
|
|
|
import com.ms.api.tool.DsJsonRequestTemplate;
|
|
|
|
|
import com.ms.api.util.DdRequestUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取抖店精选爆款的商品列表数据(蓝海商机)
|
|
|
|
|
*/
|
|
|
|
|
@ExtensionService("getShopCloudHotProducts")
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class GetShopCloudHotProductsService extends SPIBaseService implements ExtensionServiceHandler<GetShopCloudHotProductsRequestDTO, Void> {
|
|
|
|
|
public class GetShopCloudHotProductsService extends SPIBaseService implements ExtensionServiceHandler<GetShopCloudHotProductsRequestDTO, Ret> {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private DsJsonRequestTemplate dsJsonRequestTemplate;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse<Void> handle(BaseRequest<GetShopCloudHotProductsRequestDTO> req) {
|
|
|
|
|
public BaseResponse<Ret> handle(BaseRequest<GetShopCloudHotProductsRequestDTO> req) {
|
|
|
|
|
initHandle(req);
|
|
|
|
|
// ----参数校验----
|
|
|
|
|
GetShopCloudHotProductsRequestDTO fields = req.getData();
|
|
|
|
|
|
|
|
|
|
ProductIsvGetClueListRequest request = new ProductIsvGetClueListRequest();
|
|
|
|
|
ProductIsvGetClueListParam param = request.getParam();
|
|
|
|
|
param.setSourceChannelCode("competitive");
|
|
|
|
|
param.setFirstCid(20005L);
|
|
|
|
|
param.setSecondCid(20224L);
|
|
|
|
|
param.setClueInfo("线索名称");
|
|
|
|
|
param.setCurrent(1L);
|
|
|
|
|
param.setPageSize(100L);
|
|
|
|
|
param.setCompetitiveClueType(0);
|
|
|
|
|
ProductIsvGetClueListResponse response = request.execute();
|
|
|
|
|
|
|
|
|
|
// ----逻辑校验----
|
|
|
|
|
|
|
|
|
|
// ----业务处理----
|
|
|
|
|
|
|
|
|
|
// 1688暂时没提供,要确认下是否有接口,可能要从抖店云api获取
|
|
|
|
|
ProductIsvGetClueListParam param = new ProductIsvGetClueListParam();
|
|
|
|
|
param.setSourceChannelCode(fields.getSourceChannelCode());
|
|
|
|
|
param.setFirstCid(fields.getCid());
|
|
|
|
|
param.setClueInfo(fields.getKeyword());
|
|
|
|
|
param.setCurrent(fields.getPageNo());
|
|
|
|
|
param.setPageSize(fields.getPageSize());
|
|
|
|
|
ProductIsvGetClueListData data = DdRequestUtil.ProductIsvGetClueListRequest(param);
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
result.put("data", data.getData());
|
|
|
|
|
result.put("total", data.getTotal());
|
|
|
|
|
|
|
|
|
|
// ----结果返回----
|
|
|
|
|
return R.ok();
|
|
|
|
|
return R.ok(Ret.success(result));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|