Commit aeec6e3c authored by Cihat Topsakal's avatar Cihat Topsakal
Browse files

Merge branch 'edit' into 'master'

edit readme.md file spring upgrade

See merge request !1
parents 11538d7a 77c66567
Showing with 37 additions and 17 deletions
+37 -17
......@@ -209,14 +209,16 @@ public class CustomerController {
}
```
* Lastly for future purposes, add a bootstrap.yaml file under src/main/resources as below, you can clear this directory if you notice other files and it’s confusing you. And Set the kdv to use the price.
* Lastly for future purposes, rename **application.properties** -> **application.yaml** file. under src/main/resources as below.
![customer-bootstrap](./img/customer-bootstrap.jpg)
![customer-application-yaml](./img/customer-service-application-yaml.jpg)
```yaml
spring:
application:
name: customer-service
name: customer-service
config:
import: "optional:configserver:"
```
......@@ -349,16 +351,19 @@ public class ProductServiceController {
```
* Lastly for future purposes, add a **bootstrap.yaml** file. under src/main/resources as below.
* Lastly for future purposes, rename **application.properties** -> **application.yaml** file. under src/main/resources as below.
![bootstrap-yaml](./img/bootstrap-yaml.jpg)
![product-service-application-yaml](./img/product-service-application-yaml.jpg)
```yaml
spring:
application:
name: product-service
config:
import: "optional:configserver:"
kdv: 8
```
......@@ -379,19 +384,29 @@ http://localhost:8080/products/{id}
## order-service Example
1. After confirming Product Service is running without error. Generate a Spring Boot Application called order-service using Spring Initialzr by following the steps before. Generated project will be downloaded as a compressed file, extract it to a suitable directory. (Easy way, can we find setup folder)
1. Fill up the necessary fields (Group, Artifact and Dependencies) as shown below.
2. Click the import project.
![order-service-initializr](./img/order-service-initializr.jpg)
```
Gruop: com.eteration
Artifact: order-service
Project: maven
Dependicies: Spring Web, Config Client
```
3. The generated project as an Existing Maven Project as shown below.
2. After confirming Product Service is running without error. Generate a Spring Boot Application called order-service using Spring Initialzr by following the steps before. Generated project will be downloaded as a compressed file, extract it to a suitable directory. (Easy way, can we find setup folder)
3. Click the import project.
4. The generated project as an Existing Maven Project as shown below.
![existing-maven](./img/existing-maven.jpg)
4. Click the browse and select the extracted file(order-service in setup folder).
5. Click the browse and select the extracted file(order-service in setup folder).
![order-service](./img/order-service-import.png)
5. So let's create **com.eteration.orderservice.dto** DTO package and **OrderRequestDTO.Java** class.
6. So let's create **com.eteration.orderservice.dto** DTO package and **OrderRequestDTO.Java** class.
![order-request-dto](./img/order-request-dto.jpg)
......@@ -437,7 +452,7 @@ public class OrderRequestDTO {
}
```
6. Create anathor Class in **com.eteration.orderservice.dto** DTO package and **OrderResponseDTO.Java** class.
7. Create anathor Class in **com.eteration.orderservice.dto** DTO package and **OrderResponseDTO.Java** class.
![order-response-dto](./img/order-response-dto.jpg)
......@@ -484,7 +499,7 @@ public class OrderResponseDTO {
}
```
7. So let's create **com.eteration.orderservice.service** service package and **OrderService.Java** class.
8. So let's create **com.eteration.orderservice.service** service package and **OrderService.Java** class.
![order-service](./img/order-service.jpg)
......@@ -522,7 +537,7 @@ public class OrderService {
```
8. So let's create **com.eteration.orderservice.controller** DTO package and **OrderController.Java** class.
9. So let's create **com.eteration.orderservice.controller** DTO package and **OrderController.Java** class.
![order-controller](./img/order-controller.jpg)
......@@ -563,17 +578,22 @@ public class OrderController {
> This controller will return an **orderResponse** (of type OrderResponseDTO).
* Lastly for future purposes, add a bootstrap.yaml file under src/main/resources as below, you can clear this directory if you notice other files and it’s confusing you.
![order-bootstrap-yaml](./img/order-bootstrap-yaml.jpg)
* Lastly for future purposes, rename **application.properties** -> **application.yaml** file. under src/main/resources as below.
![order-service-application-yaml](./img/order-service-application-yaml.jpg)
```yaml
spring:
application:
name: order-service
config:
import: "optional:configserver:"
```
9. Open a tool that is able to make HTTP requests [Postman](https://www.postman.com/downloads/) after running **OrderServiceApplication.java**, start constructing the response body as below and
10. Open a tool that is able to make HTTP requests [Postman](https://www.postman.com/downloads/) after running **OrderServiceApplication.java**, start constructing the response body as below and
- Follow the red circles
![postman](./img/postman.jpg)
......
img/customer-service-application-yaml.jpg

21.3 KB

img/order-service-application-yaml.jpg

21.3 KB

img/order-service-initializr.jpg

90.1 KB

img/product-service-application-yaml.jpg

21.3 KB

img/spring-initializr.jpg

78.6 KB | W: 0px | H: 0px

img/spring-initializr.jpg

90.9 KB | W: 0px | H: 0px

img/spring-initializr.jpg
img/spring-initializr.jpg
img/spring-initializr.jpg
img/spring-initializr.jpg
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment