2019-11-19 19:34:57 +01:00
package org.hso.ecommerce.app ;
2020-01-20 20:22:37 +01:00
import org.hso.ecommerce.contoller.Login ;
2019-12-08 17:16:17 +01:00
import org.hso.ecommerce.db.CustomerRepository ;
import org.hso.ecommerce.entities.Customer ;
2020-01-05 01:41:45 +01:00
import org.springframework.beans.factory.annotation.Autowired ;
2019-11-19 19:34:57 +01:00
import org.springframework.stereotype.Controller ;
import org.springframework.ui.Model ;
2019-12-08 12:24:28 +01:00
import org.springframework.web.bind.annotation.* ;
import javax.servlet.http.Cookie ;
import javax.servlet.http.HttpServletResponse ;
import java.util.UUID ;
2019-11-19 19:34:57 +01:00
2020-01-15 10:55:24 +01:00
/ * *
* TODO clean up this class
* /
2019-11-19 19:34:57 +01:00
@Controller
2019-11-26 16:21:29 +01:00
public class RequestController {
2019-11-19 19:34:57 +01:00
2019-12-08 17:16:17 +01:00
private final CustomerRepository customerRepo ;
2020-01-05 01:41:45 +01:00
@Autowired
2019-12-08 17:16:17 +01:00
public RequestController ( CustomerRepository customerRepo ) {
this . customerRepo = customerRepo ;
}
2019-11-26 16:21:29 +01:00
@GetMapping ( " / " )
2020-01-23 19:08:04 +01:00
public String home ( ) {
return " redirect:/shop/ " ;
2019-11-19 19:34:57 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /login " )
public String login ( ) {
return " /login " ;
2019-11-25 16:15:36 +01:00
}
2020-01-25 20:30:26 +01:00
@PostMapping ( " /login " )
public String loginPost ( ) {
return " redirect:/ " ;
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /register " )
public String register ( ) {
return " /register " ;
2020-01-15 10:55:24 +01:00
}
2020-01-11 16:39:34 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /shop/ " )
public String shop ( ) {
return " /shop/index " ;
2020-01-18 15:34:54 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /shop/search " )
public String shopSearch ( ) {
return " /shop/search " ;
2020-01-15 10:55:24 +01:00
}
2020-01-11 16:39:34 +01:00
2020-01-25 20:30:26 +01:00
@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 " ;
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /shop/articles/{id} " )
public String shopArticlesById ( ) {
return " /shop/articles/id " ;
2020-01-22 19:27:45 +01:00
}
2020-01-16 21:01:15 +01:00
2020-01-25 20:30:26 +01:00
@PostMapping ( " /shop/articles/{id} " )
public String shopArticlesByIdBuy ( ) {
return " redirect:/shop/checkout " ;
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /user/ " )
public String user ( ) {
return " /user/index " ;
2020-01-16 21:01:15 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /user/settings " )
public String userSettings ( ) {
return " /user/settings " ;
2020-01-16 21:01:15 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /user/orders/ " )
public String userOrdeers ( ) {
2020-01-25 20:30:26 +01:00
return " /user/orders/index " ;
2020-01-19 18:43:19 +01:00
}
2020-01-16 21:01:15 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /user/bonuspoints " )
public String userBonuspoints ( ) {
return " /user/bonuspoints " ;
2020-01-19 18:48:09 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /user/notifications/ " )
public String userNotifications ( ) {
2020-01-25 20:30:26 +01:00
return " /user/notifications/index " ;
2020-01-15 10:55:24 +01:00
}
2020-01-12 18:00:40 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /about " )
public String about ( ) {
return " /about " ;
2020-01-15 10:55:24 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /terms " )
public String terms ( ) {
return " /terms " ;
2020-01-19 18:46:32 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /privacy " )
public String privacy ( ) {
return " /privacy " ;
2020-01-22 19:27:45 +01:00
}
2020-01-20 20:59:35 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/ " )
public String intern ( ) {
return " /intern/index " ;
2020-01-22 19:27:45 +01:00
}
2020-01-20 20:59:35 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/listedArticles/ " )
public String internListedArticles ( ) {
return " /intern/listedArticles/index " ;
2020-01-22 19:27:45 +01:00
}
2020-01-20 20:59:35 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/listedArticles/{id} " )
public String internListedArticlesId ( ) {
return " /intern/listedArticles/id " ;
2020-01-22 19:27:45 +01:00
}
2020-01-20 20:59:35 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/articles/ " )
public String internArticles ( ) {
return " /intern/articles/index " ;
2020-01-22 19:27:45 +01:00
}
2020-01-20 20:59:35 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/articles/{id} " )
public String internArticlesId ( ) {
return " /intern/articles/id " ;
2020-01-22 19:27:45 +01:00
}
2020-01-20 20:59:35 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/customers/ " )
public String internCustomers ( ) {
return " /intern/customers/index " ;
2020-01-22 19:27:45 +01:00
}
2020-01-20 20:59:35 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/customers/{id} " )
public String internCustomersId ( ) {
return " /intern/customers/id " ;
2020-01-15 10:55:24 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/customerOrders/ " )
public String internCustomerOrder ( ) {
return " /intern/customerOrders/index " ;
2020-01-22 19:27:45 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/customerOrders/{id} " )
public String internCustomerOrdersId ( ) {
return " /intern/customerOrders/id " ;
2020-01-22 19:27:45 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/suppliers/ " )
public String internSuppliers ( ) {
return " /intern/suppliers/index " ;
2020-01-15 10:55:24 +01:00
}
2020-01-12 19:42:04 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/suppliers/{id} " )
public String internSuppliersId ( ) {
return " /intern/suppliers/id " ;
2019-12-08 17:16:17 +01:00
}
2020-01-22 19:27:45 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/supplierOrders/ " )
public String internSupplierOrders ( ) {
return " /intern/supplierOrders/index " ;
2019-12-08 17:16:17 +01:00
}
2019-12-08 12:24:28 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/supplierOrders/{id} " )
public String internSupplierOrdersId ( ) {
return " /intern/supplierOrders/id " ;
2019-12-08 17:16:17 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/accounting/ " )
public String accounting ( ) {
return " /intern/accounting/index " ;
}
2019-12-08 17:16:17 +01:00
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/accounting/vat " )
public String accountingVat ( ) {
return " /intern/accounting/vat " ;
2019-12-08 12:24:28 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/accounting/intern " )
public String accountingIntern ( ) {
return " /intern/accounting/intern " ;
2020-01-15 10:55:24 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/accounting/addManual " )
public String accountingAddManual ( ) {
return " /intern/accounting/addManual " ;
2020-01-15 10:55:24 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/warehouse/ " )
public String accountingWarehouse ( ) {
return " /intern/warehouse/ " ;
2020-01-15 10:55:24 +01:00
}
2020-01-23 19:08:04 +01:00
@GetMapping ( " /intern/warehouse/addManual " )
public String accountingWarehouseAddManual ( ) {
return " /intern/warehouse/addManual " ;
}
2019-11-19 19:34:57 +01:00
}