This repository has been archived on 2020-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
e-commerce/prototype/src/main/java/org/hso/ecommerce/controller/intern/customers/CustomerOrderController.java

32 lines
1020 B
Java

package org.hso.ecommerce.controller.intern.customers;
import org.hso.ecommerce.entities.shop.CustomerOrder;
import org.hso.ecommerce.repos.shop.CustomerOderRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
@Controller
@RequestMapping("intern/customerOrders")
public class CustomerOrderController {
@Autowired
private final CustomerOderRepository customerOrderRepository = null;
@GetMapping("")
public String internCustomerOrder(Model model) {
List<CustomerOrder> orders = customerOrderRepository.getAllOrders();
model.addAttribute("orders", orders);
return "intern/customerOrders/index";
}
@GetMapping("/{id}")
public String internCustomerOrdersId() {
return "intern/customerOrders/id";
}
}