...
|
...
|
@@ -2,6 +2,8 @@ package com.yohoufo.product.controller; |
|
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
...
|
...
|
@@ -55,13 +57,6 @@ public class ProductController { |
|
|
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build();
|
|
|
}
|
|
|
|
|
|
private ProductDetailResp mockProductDetail(Integer productId){
|
|
|
String mockJson = "{\"product_info\":{\"brand_name\":\"Air Jordan\",\"goods_list\":[{\"color_name\":\"蓝\",\"goods_id\":40328,\"images_list\":[{\"image_url\":\"http://img13.static.yhbimg.com/goodsimg/2012/11/07/15/02c24ff8521007bad91dfa5d55e667d8f7.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80\"},{\"image_url\":\"http://img11.static.yhbimg.com/goodsimg/2013/01/09/09/0168a03a9a7df1f8ef0c1beba642a5e887.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80\"}],\"size_list\":[{\"least_price\":1,\"order_by\":1,\"size_id\":213,\"size_name\":\"XS\",\"storage_num\":1},{\"least_price\":12,\"order_by\":2,\"size_id\":207,\"size_name\":\"S\",\"storage_num\":0}]}],\"least_price\":12,\"product_code\":\"QW123456\",\"product_id\":50031387,\"product_name\":\"Carrots by Anwar X AKOP. X Champion LOGO鞋\",\"sale_time\":\"2018-08-08\",\"series_name\":\"Air Jordan 4\"}}";
|
|
|
ProductDetailResp resp = UfoJsonUtil.safelyParseObject(mockJson, ProductDetailResp.class);
|
|
|
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(name = "ufo.product.sort.template", desc="商品列表")
|
|
|
@IgnoreSignature
|
|
|
@IgnoreSession
|
...
|
...
|
@@ -70,7 +65,7 @@ public class ProductController { |
|
|
public ApiResponse querySortTemplateData(
|
|
|
@RequestParam(value = "skns", required = false) String skns) {
|
|
|
|
|
|
if (null == skns) {
|
|
|
if (StringUtils.isBlank(skns)) {
|
|
|
return new ApiResponse(500, "skns Is Null", null);
|
|
|
}
|
|
|
return new ApiResponse.ApiResponseBuilder().data(querySortTemplateData()).code(200).message("product data").build();
|
...
|
...
|
@@ -92,18 +87,10 @@ public class ProductController { |
|
|
if (storageId == null) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
StorageLeastPriceResp resp = productService.queryStorageLeastPrice(storageId);
|
|
|
return queryStorageLeastprice();
|
|
|
return productService.queryStorageLeastPrice(storageId);
|
|
|
}
|
|
|
|
|
|
|
|
|
private StorageLeastPriceResp queryStorageLeastprice(){
|
|
|
String mockJson = "{\"storage_id\":2,\"least_price\":124.3,\"skup\":1}";
|
|
|
StorageLeastPriceResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageLeastPriceResp.class);
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(name = "ufo.product.storage.data", desc="sku信息")
|
|
|
@RequestMapping(params = "method=ufo.product.storage.data")
|
|
|
//@Cachable(expire=600)
|
...
|
...
|
@@ -113,17 +100,7 @@ public class ProductController { |
|
|
if (storageId == null) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
StorageDataResp resp = productService.queryStorageInfo(storageId);
|
|
|
|
|
|
return queryStorageData();
|
|
|
}
|
|
|
|
|
|
|
|
|
private StorageDataResp queryStorageData(){
|
|
|
String mockJson = "{\"product_id\":50031387,\"product_name\":\"Carrots by Anwar X AKOP. X Champion LOGO鞋\",\"color_id\":2,\"color_name\":\"黄\",\"image_url\":\"http://img13.static.yhbimg.com/goodsimg/2012/11/07/15/02c24ff8521007bad91dfa5d55e667d8f7.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80\",\"size\":{\"size_id\":2,\"size_name\":\"S\"}}";
|
|
|
StorageDataResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageDataResp.class);
|
|
|
return resp;
|
|
|
return productService.queryStorageInfo(storageId);
|
|
|
}
|
|
|
|
|
|
// 增加库存
|
...
|
...
|
|