|
@@ -1,5 +1,6 @@
|
|
package com.cdf.controller.api;
|
|
package com.cdf.controller.api;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.cdf.common.ResultCode;
|
|
import com.cdf.common.ResultCode;
|
|
import com.cdf.common.ResultData;
|
|
import com.cdf.common.ResultData;
|
|
@@ -9,6 +10,7 @@ import com.cdf.httpClient.client.CdfClient;
|
|
import com.cdf.httpClient.client.CdfHKClient;
|
|
import com.cdf.httpClient.client.CdfHKClient;
|
|
import com.cdf.httpClient.request.CdfInCatRequest;
|
|
import com.cdf.httpClient.request.CdfInCatRequest;
|
|
import com.cdf.httpClient.response.cdf.CdfProductVo;
|
|
import com.cdf.httpClient.response.cdf.CdfProductVo;
|
|
|
|
+import com.cdf.response.SkuListVo;
|
|
import com.cdf.service.IProductSourceService;
|
|
import com.cdf.service.IProductSourceService;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -18,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/api")
|
|
@RequestMapping("/api")
|
|
@@ -69,6 +72,19 @@ public class CdfHkProductApiController {
|
|
throw new BusinessException(ResultCode.PARAM_MISS);
|
|
throw new BusinessException(ResultCode.PARAM_MISS);
|
|
}
|
|
}
|
|
CdfProductVo productById = cdfHKClient.getProductById(productSource.getCdfHost(),productSource.getCdfMchId(),productId);
|
|
CdfProductVo productById = cdfHKClient.getProductById(productSource.getCdfHost(),productSource.getCdfMchId(),productId);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 澳门店:1
|
|
|
|
+ * 东涌店:2
|
|
|
|
+ * 柬中免店:3
|
|
|
|
+ * 会员购店:12
|
|
|
|
+ * https://ar.cdfmembers.com/spu?showType=makeup&spuId=p15685542&storeId=1&userId=601131887&AccessToken=05508E6249DF10D42876C63E6823E98AAFCA8B1CD592F0D5B5A112BF3B51BB01BD5C8661A63D9D16039DA34FD0352B184F892FAB146A3531&cookieId=24fb1f47-cf3f-4a3d-c0fe-62be0c99a400
|
|
|
|
+ */
|
|
|
|
+ List<SkuListVo> skuList = cdfHKClient.getSkuList(productId, productSourceId);
|
|
|
|
+ for (SkuListVo o : skuList) {
|
|
|
|
+ o.setUrl(o.getUrl() + "&spuId=" + productId +"&storeId="+productSource);
|
|
|
|
+ }
|
|
|
|
+ productById.setSkuList(skuList);
|
|
return ResultData.ok(productById);
|
|
return ResultData.ok(productById);
|
|
}
|
|
}
|
|
}
|
|
}
|