コード例 #1
0
 @RequestMapping(value = "/user", method = RequestMethod.GET)
 public String showProfile(HttpSession session, ModelMap model) {
   User user = (User) session.getAttribute("user");
   List<Purchase> userPurchaseList = storeService.getUserPurchaseList(user.getId());
   model.addAttribute("purchaseList", userPurchaseList);
   return "user/user";
 }
コード例 #2
0
 @RequestMapping(value = "/user/confirmOrder", method = RequestMethod.POST)
 @ResponseBody
 public Response confirmOrder(HttpSession session, Locale locale) {
   Cart cart = (Cart) session.getAttribute("cart");
   User user = (User) session.getAttribute("user");
   storeService.confirmOrder(user.getId(), cart);
   Response response = new Response(messageSource, locale);
   response.addMessageByKey("cart.message.success");
   response.setStatus(Response.Status.SUCCESS);
   return response;
 }