|
|
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();
|
|
|
}
|
|
|
} |
...
|
...
|
|