|
@@ -2,6 +2,8 @@ package com.yohoufo.product.controller; |
|
@@ -2,6 +2,8 @@ package com.yohoufo.product.controller; |
2
|
|
2
|
|
3
|
import java.util.concurrent.ExecutorService;
|
3
|
import java.util.concurrent.ExecutorService;
|
4
|
import java.util.concurrent.Executors;
|
4
|
import java.util.concurrent.Executors;
|
|
|
5
|
+
|
|
|
6
|
+import org.apache.commons.lang3.StringUtils;
|
5
|
import org.slf4j.Logger;
|
7
|
import org.slf4j.Logger;
|
6
|
import org.slf4j.LoggerFactory;
|
8
|
import org.slf4j.LoggerFactory;
|
7
|
import org.springframework.beans.factory.annotation.Autowired;
|
9
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -55,13 +57,6 @@ public class ProductController { |
|
@@ -55,13 +57,6 @@ public class ProductController { |
55
|
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build();
|
57
|
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build();
|
56
|
}
|
58
|
}
|
57
|
|
59
|
|
58
|
- private ProductDetailResp mockProductDetail(Integer productId){
|
|
|
59
|
- 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\"}}";
|
|
|
60
|
- ProductDetailResp resp = UfoJsonUtil.safelyParseObject(mockJson, ProductDetailResp.class);
|
|
|
61
|
-
|
|
|
62
|
- return resp;
|
|
|
63
|
- }
|
|
|
64
|
-
|
|
|
65
|
@ApiOperation(name = "ufo.product.sort.template", desc="商品列表")
|
60
|
@ApiOperation(name = "ufo.product.sort.template", desc="商品列表")
|
66
|
@IgnoreSignature
|
61
|
@IgnoreSignature
|
67
|
@IgnoreSession
|
62
|
@IgnoreSession
|
|
@@ -70,7 +65,7 @@ public class ProductController { |
|
@@ -70,7 +65,7 @@ public class ProductController { |
70
|
public ApiResponse querySortTemplateData(
|
65
|
public ApiResponse querySortTemplateData(
|
71
|
@RequestParam(value = "skns", required = false) String skns) {
|
66
|
@RequestParam(value = "skns", required = false) String skns) {
|
72
|
|
67
|
|
73
|
- if (null == skns) {
|
68
|
+ if (StringUtils.isBlank(skns)) {
|
74
|
return new ApiResponse(500, "skns Is Null", null);
|
69
|
return new ApiResponse(500, "skns Is Null", null);
|
75
|
}
|
70
|
}
|
76
|
return new ApiResponse.ApiResponseBuilder().data(querySortTemplateData()).code(200).message("product data").build();
|
71
|
return new ApiResponse.ApiResponseBuilder().data(querySortTemplateData()).code(200).message("product data").build();
|
|
@@ -92,18 +87,10 @@ public class ProductController { |
|
@@ -92,18 +87,10 @@ public class ProductController { |
92
|
if (storageId == null) {
|
87
|
if (storageId == null) {
|
93
|
return null;
|
88
|
return null;
|
94
|
}
|
89
|
}
|
95
|
-
|
|
|
96
|
- StorageLeastPriceResp resp = productService.queryStorageLeastPrice(storageId);
|
|
|
97
|
- return queryStorageLeastprice();
|
90
|
+ return productService.queryStorageLeastPrice(storageId);
|
98
|
}
|
91
|
}
|
99
|
|
92
|
|
100
|
|
93
|
|
101
|
- private StorageLeastPriceResp queryStorageLeastprice(){
|
|
|
102
|
- String mockJson = "{\"storage_id\":2,\"least_price\":124.3,\"skup\":1}";
|
|
|
103
|
- StorageLeastPriceResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageLeastPriceResp.class);
|
|
|
104
|
- return resp;
|
|
|
105
|
- }
|
|
|
106
|
-
|
|
|
107
|
@ApiOperation(name = "ufo.product.storage.data", desc="sku信息")
|
94
|
@ApiOperation(name = "ufo.product.storage.data", desc="sku信息")
|
108
|
@RequestMapping(params = "method=ufo.product.storage.data")
|
95
|
@RequestMapping(params = "method=ufo.product.storage.data")
|
109
|
//@Cachable(expire=600)
|
96
|
//@Cachable(expire=600)
|
|
@@ -113,17 +100,7 @@ public class ProductController { |
|
@@ -113,17 +100,7 @@ public class ProductController { |
113
|
if (storageId == null) {
|
100
|
if (storageId == null) {
|
114
|
return null;
|
101
|
return null;
|
115
|
}
|
102
|
}
|
116
|
-
|
|
|
117
|
- StorageDataResp resp = productService.queryStorageInfo(storageId);
|
|
|
118
|
-
|
|
|
119
|
- return queryStorageData();
|
|
|
120
|
- }
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
- private StorageDataResp queryStorageData(){
|
|
|
124
|
- 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\"}}";
|
|
|
125
|
- StorageDataResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageDataResp.class);
|
|
|
126
|
- return resp;
|
103
|
+ return productService.queryStorageInfo(storageId);
|
127
|
}
|
104
|
}
|
128
|
|
105
|
|
129
|
// 增加库存
|
106
|
// 增加库存
|