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; @Deprecated @Controller @RequestMapping("/wechat/activity") public class LuckDrawWechatHandler { /** * 跳转抽奖页面 * 2016年9月28日 * @param req * @param res * @throws IOException * @throws ServletException */ @RequestMapping("/go_luck_draw") public void toLuckDraw(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{ String url = "/WEB-INF/views/wechat/zhuanpan.html"; toPage(req, res, url); } /** * 跳转中奖纪录页面 * 2016年9月28日 * @param req * @param res * @throws IOException * @throws ServletException */ @RequestMapping("/go_prize_log") public void toPrizeLog(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{ String url = NameUtils.getConfig("WECHAT_GO_PRIZE_LOG"); toPage(req, res, url); } /** * 分享抽奖页面 * 2016年9月29日 * @param req * @param res * @throws IOException * @throws ServletException */ @RequestMapping("/share_luck_draw") public void toShareLuckDraw(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{ String url = NameUtils.getConfig("WECHAT_GO_LUCK_DRAW"); toPage(req, res, url); } /** * 转发请求 * @param req * @param res * @param url * @throws IOException * @throws ServletException */ private void toPage(HttpServletRequest req,HttpServletResponse res,String url) throws ServletException, IOException{ req.getRequestDispatcher(url).forward(req,res); } }