package org.hso.ecommerce.controller.shop;

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

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/shop/")
public class ShopCheckoutController {

    @GetMapping("/checkout")
    public String shopCheckout(HttpSession session, HttpServletRequest request) {
        session.setAttribute("afterLogin", request.getRequestURI());
        return "shop/checkout";
    }

    @PostMapping("/checkoutFinish")
    public String shopCheckoutFinish() {
        return "shop/checkoutFinish";
    }

    @GetMapping("/checkoutFinish")
    public String shopCheckoutFinishGET() {
        return "shop/checkoutFinish";
    }
}
