package com.iamberry.wechat.handles.wx;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.iamberry.wechat.tools.NameUtils;

@Controller
@RequestMapping("/wechat/wxCart")
public class ProductCartHandler {
	
	/**
	 * 去购物车页面
	 * @param request
	 * @param response
	 * @throws IOException 
	 * @throws ServletException 
	 */
	@RequestMapping("/goCart")
	public void goCart(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.getRequestDispatcher(NameUtils.getConfig("WECHAT_SHOP_CART_INDEX")).forward(request, response);
	}
	
	/**
	 * 去产品列表页
	 * @param request
	 * @param response
	 * @throws IOException 
	 * @throws ServletException 
	 */
	@RequestMapping("/goProductList")
	public void goProductList(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.getRequestDispatcher(NameUtils.getConfig("WECHAT_SHOP_PRODUCT_LIST")).forward(request, response);
	}
	
	
	/**
	 * 去产品列表页
	 * @param request
	 * @param response
	 */
	@RequestMapping("/to_operate")
	public void toOperate(HttpServletRequest request, HttpServletResponse response) {
		try {
			request.getRequestDispatcher("/WEB-INF/views/wechat/iamberry_video_list.html").forward(request, response);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
