214 lines
5.1 KiB
Java
214 lines
5.1 KiB
Java
package org.hso.ecommerce.app;
|
|
|
|
import org.hso.ecommerce.contoller.Login;
|
|
import org.hso.ecommerce.db.CustomerRepository;
|
|
import org.hso.ecommerce.entities.Customer;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.ui.Model;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.servlet.http.Cookie;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.util.UUID;
|
|
|
|
/**
|
|
* TODO clean up this class
|
|
*/
|
|
@Controller
|
|
public class RequestController {
|
|
|
|
@GetMapping("/")
|
|
public String home() {
|
|
return "redirect:/shop/";
|
|
}
|
|
|
|
@GetMapping("/login")
|
|
public String login() {
|
|
return "/login";
|
|
}
|
|
|
|
@PostMapping("/login")
|
|
public String loginPost(HttpServletResponse response) {
|
|
response.addCookie(new Cookie("login", "true"));
|
|
return "redirect:/";
|
|
}
|
|
|
|
@PostMapping("/logout")
|
|
public String logoutPost(HttpServletResponse response) {
|
|
response.addCookie(new Cookie("login", "false"));
|
|
return "redirect:/";
|
|
}
|
|
|
|
@GetMapping("/register")
|
|
public String register() {
|
|
return "/register";
|
|
}
|
|
|
|
@GetMapping("/shop/")
|
|
public String shop() {
|
|
return "/shop/index";
|
|
}
|
|
|
|
@GetMapping("/shop/search")
|
|
public String shopSearch() {
|
|
return "/shop/search";
|
|
}
|
|
|
|
@GetMapping("/shop/checkout")
|
|
public String shopCheckout() {
|
|
return "/shop/checkout";
|
|
}
|
|
|
|
@PostMapping("/shop/checkoutFinish")
|
|
public String shopCheckoutFinish() {
|
|
return "/shop/checkoutFinish";
|
|
}
|
|
@GetMapping("/shop/checkoutFinish")
|
|
public String shopCheckoutFinishGET() {
|
|
return "/shop/checkoutFinish";
|
|
}
|
|
|
|
@GetMapping("/shop/articles/{id}")
|
|
public String shopArticlesById() {
|
|
return "/shop/articles/id";
|
|
}
|
|
|
|
@PostMapping("/shop/articles/{id}")
|
|
public String shopArticlesByIdBuy(HttpServletResponse response) {
|
|
return "redirect:/shop/checkout";
|
|
}
|
|
|
|
@GetMapping("/user/")
|
|
public String user() {
|
|
return "redirect:/user/settings";
|
|
}
|
|
|
|
@GetMapping("/user/settings")
|
|
public String userSettings() {
|
|
return "/user/settings";
|
|
}
|
|
|
|
|
|
@GetMapping("/user/orders/")
|
|
public String userOrdeers() {
|
|
return "/user/orders/index";
|
|
}
|
|
|
|
@GetMapping("/user/bonuspoints")
|
|
public String userBonuspoints() {
|
|
return "/user/bonuspoints";
|
|
}
|
|
|
|
@GetMapping("/user/notifications/")
|
|
public String userNotifications() {
|
|
return "/user/notifications/index";
|
|
}
|
|
|
|
@GetMapping("/about")
|
|
public String about() {
|
|
return "/about";
|
|
}
|
|
|
|
@GetMapping("/terms")
|
|
public String terms() {
|
|
return "/terms";
|
|
}
|
|
|
|
@GetMapping("/privacy")
|
|
public String privacy() {
|
|
return "/privacy";
|
|
}
|
|
|
|
|
|
@GetMapping("/intern/")
|
|
public String intern() {
|
|
return "/intern/index";
|
|
}
|
|
|
|
@GetMapping("/intern/listedArticles/")
|
|
public String internListedArticles() {
|
|
return "/intern/listedArticles/index";
|
|
}
|
|
|
|
@GetMapping("/intern/articles/")
|
|
public String internArticles() {
|
|
return "/intern/articles/index";
|
|
}
|
|
|
|
@GetMapping("/intern/articles/{id}")
|
|
public String internArticlesId() {
|
|
return "/intern/articles/id";
|
|
}
|
|
|
|
@GetMapping("/intern/customers/")
|
|
public String internCustomers() {
|
|
return "/intern/customers/index";
|
|
}
|
|
|
|
@GetMapping("/intern/customers/{id}")
|
|
public String internCustomersId() {
|
|
return "/intern/customers/id";
|
|
}
|
|
|
|
@GetMapping("/intern/customerOrders/")
|
|
public String internCustomerOrder() {
|
|
return "/intern/customerOrders/index";
|
|
}
|
|
|
|
@GetMapping("/intern/customerOrders/{id}")
|
|
public String internCustomerOrdersId() {
|
|
return "/intern/customerOrders/id";
|
|
}
|
|
|
|
@GetMapping("/intern/suppliers/")
|
|
public String internSuppliers() {
|
|
return "/intern/suppliers/index";
|
|
}
|
|
|
|
@GetMapping("/intern/suppliers/{id}")
|
|
public String internSuppliersId() {
|
|
return "/intern/suppliers/id";
|
|
}
|
|
|
|
@GetMapping("/intern/supplierOrders/")
|
|
public String internSupplierOrders() {
|
|
return "/intern/supplierOrders/index";
|
|
}
|
|
|
|
@GetMapping("/intern/supplierOrders/{id}")
|
|
public String internSupplierOrdersId() {
|
|
return "/intern/supplierOrders/id";
|
|
}
|
|
|
|
@GetMapping("/intern/accounting/")
|
|
public String accounting() {
|
|
return "/intern/accounting/index";
|
|
}
|
|
|
|
@GetMapping("/intern/accounting/vat")
|
|
public String accountingVat() {
|
|
return "/intern/accounting/vat";
|
|
}
|
|
|
|
@GetMapping("/intern/accounting/main")
|
|
public String accountingIntern() {
|
|
return "/intern/accounting/main";
|
|
}
|
|
|
|
@GetMapping("/intern/accounting/addManual")
|
|
public String accountingAddManual() {
|
|
return "/intern/accounting/addManual";
|
|
}
|
|
|
|
@GetMapping("/intern/warehouse/")
|
|
public String accountingWarehouse() {
|
|
return "/intern/warehouse/";
|
|
}
|
|
|
|
@GetMapping("/intern/warehouse/addManual")
|
|
public String accountingWarehouseAddManual() {
|
|
return "/intern/warehouse/addManual";
|
|
}
|
|
}
|