LuckDrawWechatHandler.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package com.iamberry.wechat.handles.wx;
  2. import java.io.IOException;
  3. import javax.servlet.ServletException;
  4. import javax.servlet.http.HttpServletRequest;
  5. import javax.servlet.http.HttpServletResponse;
  6. import org.springframework.stereotype.Controller;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import com.iamberry.wechat.tools.NameUtils;
  9. @Deprecated
  10. @Controller
  11. @RequestMapping("/wechat/activity")
  12. public class LuckDrawWechatHandler {
  13. /**
  14. * 跳转抽奖页面
  15. * 2016年9月28日
  16. * @param req
  17. * @param res
  18. * @throws IOException
  19. * @throws ServletException
  20. */
  21. @RequestMapping("/go_luck_draw")
  22. public void toLuckDraw(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{
  23. String url = "/WEB-INF/views/wechat/zhuanpan.html";
  24. toPage(req, res, url);
  25. }
  26. /**
  27. * 跳转中奖纪录页面
  28. * 2016年9月28日
  29. * @param req
  30. * @param res
  31. * @throws IOException
  32. * @throws ServletException
  33. */
  34. @RequestMapping("/go_prize_log")
  35. public void toPrizeLog(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{
  36. String url = NameUtils.getConfig("WECHAT_GO_PRIZE_LOG");
  37. toPage(req, res, url);
  38. }
  39. /**
  40. * 分享抽奖页面
  41. * 2016年9月29日
  42. * @param req
  43. * @param res
  44. * @throws IOException
  45. * @throws ServletException
  46. */
  47. @RequestMapping("/share_luck_draw")
  48. public void toShareLuckDraw(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{
  49. String url = NameUtils.getConfig("WECHAT_GO_LUCK_DRAW");
  50. toPage(req, res, url);
  51. }
  52. /**
  53. * 转发请求
  54. * @param req
  55. * @param res
  56. * @param url
  57. * @throws IOException
  58. * @throws ServletException
  59. */
  60. private void toPage(HttpServletRequest req,HttpServletResponse res,String url) throws ServletException, IOException{
  61. req.getRequestDispatcher(url).forward(req,res);
  62. }
  63. }