Merge branch 'dev' of http://git.yoho.cn/ufo/yohoufo-fore into dev
Showing
3 changed files
with
40 additions
and
6 deletions
@@ -44,13 +44,12 @@ public class ProductController { | @@ -44,13 +44,12 @@ public class ProductController { | ||
44 | @Cachable(expire = 300) | 44 | @Cachable(expire = 300) |
45 | public ApiResponse queryProductDetailById( | 45 | public ApiResponse queryProductDetailById( |
46 | @RequestParam(value = "product_id") Integer productId) { | 46 | @RequestParam(value = "product_id") Integer productId) { |
47 | - | ||
48 | if (null == productId) { | 47 | if (null == productId) { |
48 | + LOG.info("in method=ufo.product.data product_id Is Null"); | ||
49 | return new ApiResponse(400, "product_id Is Null", null); | 49 | return new ApiResponse(400, "product_id Is Null", null); |
50 | } | 50 | } |
51 | - | 51 | + LOG.info("in method=ufo.product.data product_id={}", productId); |
52 | ProductDetailResp resp = productService.queryProductDetailById(productId); | 52 | ProductDetailResp resp = productService.queryProductDetailById(productId); |
53 | - | ||
54 | return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build(); | 53 | return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build(); |
55 | } | 54 | } |
56 | 55 | ||
@@ -63,8 +62,10 @@ public class ProductController { | @@ -63,8 +62,10 @@ public class ProductController { | ||
63 | @RequestParam(value = "product_ids") String productIds) { | 62 | @RequestParam(value = "product_ids") String productIds) { |
64 | 63 | ||
65 | if (StringUtils.isBlank(productIds)) { | 64 | if (StringUtils.isBlank(productIds)) { |
65 | + LOG.info("in method=ufo.product.series.template product_ids Is Null or empty"); | ||
66 | return new ApiResponse(400, "productIds Is Null", null); | 66 | return new ApiResponse(400, "productIds Is Null", null); |
67 | } | 67 | } |
68 | + LOG.info("in method=ufo.product.series.template product_ids={}", productIds); | ||
68 | ProductSeriesTemplateResp resp = productService.querySeriesTemplateData(productIds); | 69 | ProductSeriesTemplateResp resp = productService.querySeriesTemplateData(productIds); |
69 | return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build(); | 70 | return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build(); |
70 | } | 71 | } |
@@ -78,8 +79,10 @@ public class ProductController { | @@ -78,8 +79,10 @@ public class ProductController { | ||
78 | @RequestParam(value = "product_ids") String productIds) { | 79 | @RequestParam(value = "product_ids") String productIds) { |
79 | 80 | ||
80 | if (StringUtils.isBlank(productIds)) { | 81 | if (StringUtils.isBlank(productIds)) { |
82 | + LOG.info("in method=ufo.product.sort.template product_ids Is Null or empty"); | ||
81 | return new ApiResponse(400, "productIds Is Null", null); | 83 | return new ApiResponse(400, "productIds Is Null", null); |
82 | } | 84 | } |
85 | + LOG.info("in method=ufo.product.sort.template product_ids={}", productIds); | ||
83 | ProductSortTemplateResp resp = productService.querySortTemplateData(productIds); | 86 | ProductSortTemplateResp resp = productService.querySortTemplateData(productIds); |
84 | return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build(); | 87 | return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build(); |
85 | } | 88 | } |
@@ -88,11 +91,13 @@ public class ProductController { | @@ -88,11 +91,13 @@ public class ProductController { | ||
88 | @RequestMapping(params = "method=ufo.product.storage.leastprice") | 91 | @RequestMapping(params = "method=ufo.product.storage.leastprice") |
89 | @Cachable(expire = 300) | 92 | @Cachable(expire = 300) |
90 | public StorageLeastPriceResp queryStorageLeastprice( | 93 | public StorageLeastPriceResp queryStorageLeastprice( |
91 | - @RequestParam(value = "storage_id", required = true) Integer storageId) { | 94 | + @RequestParam(value = "storage_id") Integer storageId) { |
92 | 95 | ||
93 | if (storageId == null) { | 96 | if (storageId == null) { |
97 | + LOG.info("in method=ufo.product.storage.leastprice storage_id Is Null"); | ||
94 | return null; | 98 | return null; |
95 | } | 99 | } |
100 | + LOG.info("in method=ufo.product.storage.leastprice storage_id={}", storageId); | ||
96 | return productService.queryStorageLeastPrice(storageId); | 101 | return productService.queryStorageLeastPrice(storageId); |
97 | } | 102 | } |
98 | 103 | ||
@@ -101,11 +106,13 @@ public class ProductController { | @@ -101,11 +106,13 @@ public class ProductController { | ||
101 | @RequestMapping(params = "method=ufo.product.storage.data") | 106 | @RequestMapping(params = "method=ufo.product.storage.data") |
102 | @Cachable(expire = 300) | 107 | @Cachable(expire = 300) |
103 | public StorageDataResp queryStorageInfo( | 108 | public StorageDataResp queryStorageInfo( |
104 | - @RequestParam(value = "storage_id", required = true) Integer storageId) { | 109 | + @RequestParam(value = "storage_id") Integer storageId) { |
105 | 110 | ||
106 | if (storageId == null) { | 111 | if (storageId == null) { |
112 | + LOG.info("in method=ufo.product.storage.data storage_id Is Null"); | ||
107 | return null; | 113 | return null; |
108 | } | 114 | } |
115 | + LOG.info("in method=ufo.product.storage.data storage_id={}", storageId); | ||
109 | return productService.queryStorageInfo(storageId); | 116 | return productService.queryStorageInfo(storageId); |
110 | } | 117 | } |
111 | 118 |
@@ -53,6 +53,8 @@ public class ProductSearchController { | @@ -53,6 +53,8 @@ public class ProductSearchController { | ||
53 | ProductSearchReq req = new ProductSearchReq().setOrder(order).setPool(productPool).setBrand(brand).setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId()) | 53 | ProductSearchReq req = new ProductSearchReq().setOrder(order).setPool(productPool).setBrand(brand).setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId()) |
54 | .setSeries(series).setGender(gender).setSize(size).setIsSoonSale(isSoonSale).setViewNum(limit).setPage(page); | 54 | .setSeries(series).setGender(gender).setSize(size).setIsSoonSale(isSoonSale).setViewNum(limit).setPage(page); |
55 | searchHelpService.setQuery(query, req); | 55 | searchHelpService.setQuery(query, req); |
56 | + LOG.info("in method=ufo.product.search.list req={}", req.toString()); | ||
57 | + | ||
56 | JSONObject resp = productSearchService.searchProductList(req); | 58 | JSONObject resp = productSearchService.searchProductList(req); |
57 | return new ApiResponse.ApiResponseBuilder().code(200).message("Product List.").data(resp).build(); | 59 | return new ApiResponse.ApiResponseBuilder().code(200).message("Product List.").data(resp).build(); |
58 | } | 60 | } |
@@ -65,8 +67,10 @@ public class ProductSearchController { | @@ -65,8 +67,10 @@ public class ProductSearchController { | ||
65 | public ApiResponse searchProductRecommendById(@RequestParam(value = "product_id") Integer productId) { | 67 | public ApiResponse searchProductRecommendById(@RequestParam(value = "product_id") Integer productId) { |
66 | 68 | ||
67 | if (null == productId) { | 69 | if (null == productId) { |
70 | + LOG.info("in method=ufo.product.data.search.recommend product_id is null"); | ||
68 | return new ApiResponse(400, "product_id Is Null", null); | 71 | return new ApiResponse(400, "product_id Is Null", null); |
69 | } | 72 | } |
73 | + LOG.info("in method=ufo.product.data.search.recommend product_id={}", productId); | ||
70 | SearchProductRecommendResp resp = productSearchService.searchProductRecommendById(productId); | 74 | SearchProductRecommendResp resp = productSearchService.searchProductRecommendById(productId); |
71 | return new ApiResponse.ApiResponseBuilder().code(200).message("product.data.search.recommend").data(resp).build(); | 75 | return new ApiResponse.ApiResponseBuilder().code(200).message("product.data.search.recommend").data(resp).build(); |
72 | } | 76 | } |
@@ -92,9 +96,9 @@ public class ProductSearchController { | @@ -92,9 +96,9 @@ public class ProductSearchController { | ||
92 | ProductSearchReq req = new ProductSearchReq().setPool(productPool).setBrand(brand).setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId()) | 96 | ProductSearchReq req = new ProductSearchReq().setPool(productPool).setBrand(brand).setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId()) |
93 | .setSeries(series).setGender(gender).setSize(size).setIsSoonSale(isSoonSale); | 97 | .setSeries(series).setGender(gender).setSize(size).setIsSoonSale(isSoonSale); |
94 | searchHelpService.setQuery(query, req); | 98 | searchHelpService.setQuery(query, req); |
99 | + LOG.info("in method=ufo.product.search.list req={}", req.toString()); | ||
95 | 100 | ||
96 | SearchProductListFilterResp resp = productSearchService.searchProductListFilter(req); | 101 | SearchProductListFilterResp resp = productSearchService.searchProductListFilter(req); |
97 | - | ||
98 | return new ApiResponse.ApiResponseBuilder().code(200).message("product.search.list.filter").data(resp).build(); | 102 | return new ApiResponse.ApiResponseBuilder().code(200).message("product.search.list.filter").data(resp).build(); |
99 | } | 103 | } |
100 | 104 |
1 | package com.yohoufo.product.request; | 1 | package com.yohoufo.product.request; |
2 | 2 | ||
3 | +import org.apache.commons.lang3.builder.ToStringBuilder; | ||
4 | + | ||
3 | public class ProductSearchReq { | 5 | public class ProductSearchReq { |
4 | 6 | ||
5 | private Integer id; | 7 | private Integer id; |
@@ -18,6 +20,26 @@ public class ProductSearchReq { | @@ -18,6 +20,26 @@ public class ProductSearchReq { | ||
18 | private String not_id; | 20 | private String not_id; |
19 | 21 | ||
20 | 22 | ||
23 | + @Override | ||
24 | + public String toString() { | ||
25 | + return new ToStringBuilder(this) | ||
26 | + .append("page", page) | ||
27 | + .append("order", order) | ||
28 | + .append("gender", gender) | ||
29 | + .append("viewNum", viewNum) | ||
30 | + .append("brand", brand) | ||
31 | + .append("size", size) | ||
32 | + .append("query", query) | ||
33 | + .append("maxSort", maxSort) | ||
34 | + .append("midSort", midSort) | ||
35 | + .append("series", series) | ||
36 | + .append("pool", pool) | ||
37 | + .append("isSoonSale", isSoonSale) | ||
38 | + .append("not_id", not_id) | ||
39 | + .toString(); | ||
40 | + } | ||
41 | + | ||
42 | + | ||
21 | public Integer getId() { | 43 | public Integer getId() { |
22 | return id; | 44 | return id; |
23 | } | 45 | } |
@@ -144,4 +166,5 @@ public class ProductSearchReq { | @@ -144,4 +166,5 @@ public class ProductSearchReq { | ||
144 | this.not_id = not_id; | 166 | this.not_id = not_id; |
145 | return this; | 167 | return this; |
146 | } | 168 | } |
169 | + | ||
147 | } | 170 | } |
-
Please register or login to post a comment