ReducePriceSceneController.java 1.58 KB
package com.yoho.search.restapi.scene;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yoho.search.aop.downgrade.PersionalRateLimit;
import com.yoho.search.common.utils.HttpServletRequestUtils;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.ReducePriceSceneService;

/**
 * 最新降价的场景
 * 
 * @author gufei.hu
 */

@Controller
public class ReducePriceSceneController {

	@Autowired
	private ReducePriceSceneService reducePriceSceneService;

	/**
	 * 最新降价的商品列表
	 *
	 * @return
	 */
	@PersionalRateLimit(isOrderUseable = true)
	@RequestMapping(method = RequestMethod.GET, value = "/reducePrice/productList")
	@ResponseBody
	public SearchApiResult reducePriceProductList(HttpServletRequest request) {
		Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
		return reducePriceSceneService.productList(paramMap);
	}

	/**
	 * 最新降价的筛选项
	 *
	 * @return
	 */
	@RequestMapping(method = RequestMethod.GET, value = "/reducePrice/old/aggregations")
	@ResponseBody
	public SearchApiResult reducePriceAggregations(HttpServletRequest request) {
		Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
		return reducePriceSceneService.aggregations(paramMap);
	}
}