Authored by ken.hu

Merge branch 'dev' of http://git.yoho.cn/ufo/yohoufo-fore into dev

... ... @@ -44,13 +44,12 @@ public class ProductController {
@Cachable(expire = 300)
public ApiResponse queryProductDetailById(
@RequestParam(value = "product_id") Integer productId) {
if (null == productId) {
LOG.info("in method=ufo.product.data product_id Is Null");
return new ApiResponse(400, "product_id Is Null", null);
}
LOG.info("in method=ufo.product.data product_id={}", productId);
ProductDetailResp resp = productService.queryProductDetailById(productId);
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build();
}
... ... @@ -63,8 +62,10 @@ public class ProductController {
@RequestParam(value = "product_ids") String productIds) {
if (StringUtils.isBlank(productIds)) {
LOG.info("in method=ufo.product.series.template product_ids Is Null or empty");
return new ApiResponse(400, "productIds Is Null", null);
}
LOG.info("in method=ufo.product.series.template product_ids={}", productIds);
ProductSeriesTemplateResp resp = productService.querySeriesTemplateData(productIds);
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build();
}
... ... @@ -78,8 +79,10 @@ public class ProductController {
@RequestParam(value = "product_ids") String productIds) {
if (StringUtils.isBlank(productIds)) {
LOG.info("in method=ufo.product.sort.template product_ids Is Null or empty");
return new ApiResponse(400, "productIds Is Null", null);
}
LOG.info("in method=ufo.product.sort.template product_ids={}", productIds);
ProductSortTemplateResp resp = productService.querySortTemplateData(productIds);
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build();
}
... ... @@ -88,11 +91,13 @@ public class ProductController {
@RequestMapping(params = "method=ufo.product.storage.leastprice")
@Cachable(expire = 300)
public StorageLeastPriceResp queryStorageLeastprice(
@RequestParam(value = "storage_id", required = true) Integer storageId) {
@RequestParam(value = "storage_id") Integer storageId) {
if (storageId == null) {
LOG.info("in method=ufo.product.storage.leastprice storage_id Is Null");
return null;
}
LOG.info("in method=ufo.product.storage.leastprice storage_id={}", storageId);
return productService.queryStorageLeastPrice(storageId);
}
... ... @@ -101,11 +106,13 @@ public class ProductController {
@RequestMapping(params = "method=ufo.product.storage.data")
@Cachable(expire = 300)
public StorageDataResp queryStorageInfo(
@RequestParam(value = "storage_id", required = true) Integer storageId) {
@RequestParam(value = "storage_id") Integer storageId) {
if (storageId == null) {
LOG.info("in method=ufo.product.storage.data storage_id Is Null");
return null;
}
LOG.info("in method=ufo.product.storage.data storage_id={}", storageId);
return productService.queryStorageInfo(storageId);
}
... ...
... ... @@ -53,6 +53,8 @@ public class ProductSearchController {
ProductSearchReq req = new ProductSearchReq().setOrder(order).setPool(productPool).setBrand(brand).setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId())
.setSeries(series).setGender(gender).setSize(size).setIsSoonSale(isSoonSale).setViewNum(limit).setPage(page);
searchHelpService.setQuery(query, req);
LOG.info("in method=ufo.product.search.list req={}", req.toString());
JSONObject resp = productSearchService.searchProductList(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("Product List.").data(resp).build();
}
... ... @@ -65,8 +67,10 @@ public class ProductSearchController {
public ApiResponse searchProductRecommendById(@RequestParam(value = "product_id") Integer productId) {
if (null == productId) {
LOG.info("in method=ufo.product.data.search.recommend product_id is null");
return new ApiResponse(400, "product_id Is Null", null);
}
LOG.info("in method=ufo.product.data.search.recommend product_id={}", productId);
SearchProductRecommendResp resp = productSearchService.searchProductRecommendById(productId);
return new ApiResponse.ApiResponseBuilder().code(200).message("product.data.search.recommend").data(resp).build();
}
... ... @@ -92,9 +96,9 @@ public class ProductSearchController {
ProductSearchReq req = new ProductSearchReq().setPool(productPool).setBrand(brand).setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId())
.setSeries(series).setGender(gender).setSize(size).setIsSoonSale(isSoonSale);
searchHelpService.setQuery(query, req);
LOG.info("in method=ufo.product.search.list req={}", req.toString());
SearchProductListFilterResp resp = productSearchService.searchProductListFilter(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("product.search.list.filter").data(resp).build();
}
... ...
package com.yohoufo.product.request;
import org.apache.commons.lang3.builder.ToStringBuilder;
public class ProductSearchReq {
private Integer id;
... ... @@ -18,6 +20,26 @@ public class ProductSearchReq {
private String not_id;
@Override
public String toString() {
return new ToStringBuilder(this)
.append("page", page)
.append("order", order)
.append("gender", gender)
.append("viewNum", viewNum)
.append("brand", brand)
.append("size", size)
.append("query", query)
.append("maxSort", maxSort)
.append("midSort", midSort)
.append("series", series)
.append("pool", pool)
.append("isSoonSale", isSoonSale)
.append("not_id", not_id)
.toString();
}
public Integer getId() {
return id;
}
... ... @@ -144,4 +166,5 @@ public class ProductSearchReq {
this.not_id = not_id;
return this;
}
}
... ...