The course is part of this learning path
In this course, we will learn the concepts of microservice and spring framework with a focus on Spring Boot.
- Understanding Spring Boot
- Beginner Java developers
- Java developers interested in learning how to Build and Deploy RESTful Web Services
- Java Developers who want to develop web applications using the Spring framework
- Java Developers who want to develop web applications with microservices
- Java Developers who wish to develop Spring Boot Microservices with Spring Cloud
- Basic Java knowledge
Hello friends. In this video, we'll work on the sales operations on the employee product list page. Let's begin. First, I want to start with the controller. Open EmployeeController. On this page, we will sell a product that is added to the basket. We'll start by adding products to the basket. And after we create a bill for it, the sale will be complete. After that, we will prove this bill as an employee and as an administrator. First, we need a new page for adding products to the basket. Add a new method and call it ProductDetail. This will take an ID parameter with a PathVariable. Path will be ProductDetail. Now, in this, we'll get the ProductById. Now, set this product to the model.
Also, for adding to the basket, we have to add a soldProduct entity. Set to the model. Now, return to the ProductDetail page. We don't have a product detail page yet but we will add one. Let's add. Add a new HTML and name it ProductDetail. On this page, we can see the product's price, name, and stock amount together. We can copy the codes from the add product page if you like, but I want to design a new page.
First, I need some p tags to show the product name, price, and stock amount. Now, we need a form. With this forms action, we will add products to the basket with the selected quantity, so I wanted to find a new action. AddBasket, method will be post. In this form, we only needed the desired product quantity. Now add an input with a stock order ID. Done.
Now, try 500. And look, we have an error message and the button is disabled. Change to five. And look, the button is now active. Done. Let's take a quick break here. And in the following video, we'll go over the add basket and create bill operations. I'll see you in the following video.
OAK Academy is made up of tech experts who have been in the sector for years and years and are deeply rooted in the tech world. They specialize in critical areas like cybersecurity, coding, IT, game development, app monetization, and mobile development.