Authored by mali

价格走势

... ... @@ -487,4 +487,19 @@ public class ProductController {
SkupDetailForScreenResp resp = productService.getSkuPDetailForShopsScreen(skuP, storeId);
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("sku-p detail").build();
}
@ApiOperation(name = "ufo.product.sizes", desc="商品的尺码列表")
@IgnoreSignature
@IgnoreSession
@RequestMapping(params = "method=ufo.product.sizes")
@Cachable(expire = 180)
public ApiResponse queryProductSizeById(@RequestParam(value = "product_id") Integer productId) {
if (null == productId) {
LOG.info("in method=ufo.product.sizes product_id Is Null");
return new ApiResponse(400, "product_id Is Null", null);
}
LOG.info("in method=ufo.product.sizes product_id={}", productId);
ProductDetailResp resp = productService.queryProductSizeById(productId);
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product size data").build();
}
}
\ No newline at end of file
... ...
package com.yohoufo.product.controller;
import com.yoho.tools.docs.ApiOperation;
import com.yohobuy.ufo.model.response.ProductDetailResp;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
import com.yohoufo.common.cache.Cachable;
import com.yohoufo.product.service.impl.ProductPriceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by li.ma on 2019/1/8.
*/
@RestController
public class ProductPriceController {
private final Logger LOG = LoggerFactory.getLogger(ProductPriceController.class);
@Autowired
private ProductPriceService productPriceService;
@ApiOperation(name = "ufo.product.data", desc="商品详情")
@IgnoreSignature
@IgnoreSession
@RequestMapping(params = "method=ufo.product.priceTrend")
@Cachable(expire = 180)
public ApiResponse queryProductPriceTrend(@RequestParam(value = "product_id") Integer productId,
@RequestParam(value = "size_id", required = false) Integer sizeId) {
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 = productPriceService.queryProductPriceTrend(productId);
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build();
}
}
... ...
... ... @@ -83,4 +83,11 @@ public interface ProductService {
* @return
*/
SkupDetailForScreenResp getSkuPDetailForShopsScreen(Integer skuP, Integer storeId);
/**
* 根据
* @param productId
* @return
*/
ProductDetailResp queryProductSizeById(Integer productId);
}
... ...
package com.yohoufo.product.service.impl;
import org.springframework.stereotype.Service;
/**
* Created by li.ma on 2019/1/8.
*/
@Service
public class ProductPriceService {
}
... ...