diff --git a/spring-boot-modules/spring-boot-microservices/README.md b/spring-boot-modules/spring-boot-microservices/README.md deleted file mode 100644 index a85d52b2bc..0000000000 --- a/spring-boot-modules/spring-boot-microservices/README.md +++ /dev/null @@ -1,11 +0,0 @@ ---------------------------------- CustomerOrderApp installation steps---------------------------------- - -1. Clone or download sample project from GitHub repo: https://github.com/eugenp/tutorials/tree/master/spring-boot-modules/spring-boot-microservices -2. Unzip project folder to local disk for example to: C:/baeldung-tutorials/spring-boot-microservices/customer-order-app -3. Run `mvn clean install -DskipTests=true` -4. Navigate to order-service/order-server module folder and type `mvn spring-boot:run` -5. Open another CMD PROMPT window. - Navigate to customer-service module folder and type `mvn spring-boot:run` - -6. Launch the Postman application from your machine and import the collection located in the _postman_ folder in project root -7. Verify successful request from the POSTMAN to http://localhost:8001/customer-service/order diff --git a/spring-boot-modules/spring-boot-microservices/customer-service/.gitignore b/spring-boot-modules/spring-boot-microservices/customer-service/.gitignore deleted file mode 100644 index 0e9415ada6..0000000000 --- a/spring-boot-modules/spring-boot-microservices/customer-service/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -#https://github.com/spring-projects/spring-boot/blob/master/.gitignore - -*# -*.iml -*.ipr -*.iws -*.jar -*.sw? -*~ -.#* -.*.md.html -.DS_Store -.classpath -.factorypath -.gradle -.idea -.metadata -.project -.recommenders -.settings -.springBeans -/build -/code -MANIFEST.MF -_site/ -activemq-data -bin -build -build.log -dependency-reduced-pom.xml -dump.rdb -interpolated*.xml -lib/ -manifest.yml -overridedb.* -target -transaction-logs -.flattened-pom.xml -secrets.yml -.gradletasknamecache -.sts4-cache diff --git a/spring-boot-modules/spring-boot-microservices/customer-service/pom.xml b/spring-boot-modules/spring-boot-microservices/customer-service/pom.xml deleted file mode 100644 index a02ce2e1d8..0000000000 --- a/spring-boot-modules/spring-boot-microservices/customer-service/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - CustomerOrderApp - com.baeldung - 1.0-SNAPSHOT - - 4.0.0 - - com.baeldung.customerservice - customer-service - jar - - - 1.8 - 1.8 - 1.8 - UTF-8 - - - - - - org.springframework.boot - spring-boot-dependencies - 2.3.0.RELEASE - pom - import - - - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-json - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-configuration-processor - - - junit - junit - test - - - com.baeldung.orderservice - order-client - 1.0-SNAPSHOT - compile - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - exec - - - - - - - - diff --git a/spring-boot-modules/spring-boot-microservices/customer-service/src/main/java/com/baeldung/customerservice/Customer.java b/spring-boot-modules/spring-boot-microservices/customer-service/src/main/java/com/baeldung/customerservice/Customer.java deleted file mode 100644 index 7d10510cbc..0000000000 --- a/spring-boot-modules/spring-boot-microservices/customer-service/src/main/java/com/baeldung/customerservice/Customer.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.customerservice; - -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -public class Customer { - - private int id; - private String firstName; - private String lastName; - -} \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-microservices/customer-service/src/main/java/com/baeldung/customerservice/CustomerApplication.java b/spring-boot-modules/spring-boot-microservices/customer-service/src/main/java/com/baeldung/customerservice/CustomerApplication.java deleted file mode 100644 index 489129a3d2..0000000000 --- a/spring-boot-modules/spring-boot-microservices/customer-service/src/main/java/com/baeldung/customerservice/CustomerApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.customerservice; - -import com.baeldung.orderservice.client.OrderClient; -import com.baeldung.orderservice.client.OrderClientImpl; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.context.annotation.Bean; - -/** - * Spring Boot application starter class - */ -@SpringBootApplication -public class CustomerApplication { - public static void main(String[] args) { - SpringApplication.run(CustomerApplication.class, args); - } - - @Bean - public OrderClient getOrderClient() { - - return new OrderClientImpl(new RestTemplateBuilder()); - } - -} diff --git a/spring-boot-modules/spring-boot-microservices/customer-service/src/main/java/com/baeldung/customerservice/CustomerService.java b/spring-boot-modules/spring-boot-microservices/customer-service/src/main/java/com/baeldung/customerservice/CustomerService.java deleted file mode 100644 index ab8872de1c..0000000000 --- a/spring-boot-modules/spring-boot-microservices/customer-service/src/main/java/com/baeldung/customerservice/CustomerService.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.baeldung.customerservice; - -import com.baeldung.orderservice.client.OrderClient; -import com.baeldung.orderservice.client.OrderDTO; -import com.baeldung.orderservice.client.OrderResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -@RestController -public class CustomerService { - - @Autowired - private OrderClient orderClient; - - private List customers = Arrays.asList( - - new Customer(1, "John", "Smith"), - new Customer(2, "Deny", "Dominic")); - - - @GetMapping - public List getAllCustomers() { - return customers; - } - - @GetMapping("/{id}") - public Customer getCustomerById(@PathVariable int id) { - return customers.stream() - .filter(customer -> customer.getId() == id) - .findFirst() - .orElseThrow(IllegalArgumentException::new); - } - - - @PostMapping(value = "/order") - public String sendOrder(@RequestBody Map body) { - - OrderDTO dto = new OrderDTO(); - dto.setCustomerId((Integer) body.get("customerId")); - dto.setItemId((String) body.get("itemId")); - - OrderResponse response = orderClient.order(dto); - - return response.getStatus(); - } - -} \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-microservices/customer-service/src/main/resources/application.properties b/spring-boot-modules/spring-boot-microservices/customer-service/src/main/resources/application.properties deleted file mode 100644 index d439ae9b76..0000000000 --- a/spring-boot-modules/spring-boot-microservices/customer-service/src/main/resources/application.properties +++ /dev/null @@ -1,4 +0,0 @@ -#Spring Boot server configuration -server.servlet.context-path=/customer-service -server.port=8001 - diff --git a/spring-boot-modules/spring-boot-microservices/customer-service/src/test/java/com/baeldung/customerservice/CustomerServiceTest.java b/spring-boot-modules/spring-boot-microservices/customer-service/src/test/java/com/baeldung/customerservice/CustomerServiceTest.java deleted file mode 100644 index 1c44146811..0000000000 --- a/spring-boot-modules/spring-boot-microservices/customer-service/src/test/java/com/baeldung/customerservice/CustomerServiceTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.baeldung.customerservice; - -import com.baeldung.orderservice.client.OrderClient; -import com.baeldung.orderservice.client.OrderDTO; -import com.baeldung.orderservice.client.OrderResponse; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = CustomerApplication.class) -public class CustomerServiceTest { - - @Autowired - private OrderClient orderClient; - - @Test - public void testAddOrderSuccess(){ - - - OrderDTO dto = new OrderDTO(2,"A152"); - - OrderResponse response = orderClient.order(dto); - - Assert.assertNotNull("Order Id not generated", response.getOrderId()); - Assert.assertEquals("A152", response.getProductId()); - Assert.assertEquals("CREATED", response.getStatus()); - } - -} diff --git a/spring-boot-modules/spring-boot-microservices/customer-service/src/test/resources/application.properties b/spring-boot-modules/spring-boot-microservices/customer-service/src/test/resources/application.properties deleted file mode 100644 index 1d50559005..0000000000 --- a/spring-boot-modules/spring-boot-microservices/customer-service/src/test/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -local.server.port=8001 -server.servlet.context-path=/customer-service \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-microservices/order-service/.gitignore b/spring-boot-modules/spring-boot-microservices/order-service/.gitignore deleted file mode 100644 index 0e9415ada6..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -#https://github.com/spring-projects/spring-boot/blob/master/.gitignore - -*# -*.iml -*.ipr -*.iws -*.jar -*.sw? -*~ -.#* -.*.md.html -.DS_Store -.classpath -.factorypath -.gradle -.idea -.metadata -.project -.recommenders -.settings -.springBeans -/build -/code -MANIFEST.MF -_site/ -activemq-data -bin -build -build.log -dependency-reduced-pom.xml -dump.rdb -interpolated*.xml -lib/ -manifest.yml -overridedb.* -target -transaction-logs -.flattened-pom.xml -secrets.yml -.gradletasknamecache -.sts4-cache diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-client/pom.xml b/spring-boot-modules/spring-boot-microservices/order-service/order-client/pom.xml deleted file mode 100644 index 22176bb85e..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-client/pom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - 4.0.0 - - - com.baeldung.orderservice - order-service - 1.0-SNAPSHOT - - order-client - com.baeldung.orderservice - order-client - Order service client module - http://projects.spring.io/spring-boot/ - - diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClient.java b/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClient.java deleted file mode 100644 index 2dd6b13248..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClient.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.baeldung.orderservice.client; - -public interface OrderClient { - - OrderResponse order(OrderDTO orderDTO); -} diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClientImpl.java b/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClientImpl.java deleted file mode 100644 index 70ec77fab6..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClientImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.baeldung.orderservice.client; - -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.client.RestTemplate; - - -@Component -public class OrderClientImpl implements OrderClient { - - private RestTemplate restTemplate; - - public OrderClientImpl(RestTemplateBuilder builder) { - - this.restTemplate = builder.build(); - } - - @Override - public OrderResponse order(OrderDTO orderDTO) { - - String serviceUrl = "http://localhost:8002/order-service"; - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - - HttpEntity request = new HttpEntity<>(orderDTO, headers); - - OrderResponse orderResponse = restTemplate.postForObject(serviceUrl + "/create", request, OrderResponse.class); - - return orderResponse; - - } -} diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderDTO.java b/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderDTO.java deleted file mode 100644 index c31c9f6bec..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.orderservice.client; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class OrderDTO { - - private int customerId; - private String itemId; - -} diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderResponse.java b/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderResponse.java deleted file mode 100644 index e8d2059cbb..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.orderservice.client; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class OrderResponse { - - private int orderId; - private String productId; - private String status; -} diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/resources/application.properties b/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/resources/application.properties deleted file mode 100644 index 53e503689f..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-client/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -server.port=8002 \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-server/pom.xml b/spring-boot-modules/spring-boot-microservices/order-service/order-server/pom.xml deleted file mode 100644 index 722bfa5aac..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-server/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - order-service - com.baeldung.orderservice - 1.0-SNAPSHOT - - 4.0.0 - - com.baeldung.orderservice - order-server - - - com.baeldung.orderservice - order-client - 1.0-SNAPSHOT - compile - - - com.baeldung.paymentservice - payment-client - 1.0-SNAPSHOT - compile - - - - \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/java/com/baeldung/orderservice/Order.java b/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/java/com/baeldung/orderservice/Order.java deleted file mode 100644 index 719305064f..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/java/com/baeldung/orderservice/Order.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.orderservice; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class Order { - - private Integer id; - private Integer customerId; - private String itemId; - private String date; - -} diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderApplication.java b/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderApplication.java deleted file mode 100644 index 2d09479a57..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderApplication.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.orderservice; - -import com.baeldung.paymentservice.PaymentClient; -import com.baeldung.paymentservice.PaymentClientImpl; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.context.annotation.Bean; - -/** - * Spring Boot application starter class - */ -@SpringBootApplication -public class OrderApplication { - public static void main(String[] args) { - SpringApplication.run(OrderApplication.class, args); - } - - @Bean - public PaymentClient getPaymentClient() { - - return new PaymentClientImpl(new RestTemplateBuilder()); - } -} diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderService.java b/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderService.java deleted file mode 100644 index 09d72e63f4..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.baeldung.orderservice; - -import com.baeldung.orderservice.client.OrderDTO; -import com.baeldung.orderservice.client.OrderResponse; -import com.baeldung.paymentservice.PaymentClient; -import com.baeldung.paymentservice.PaymentDTO; -import com.baeldung.paymentservice.PaymentResponse; -import org.apache.commons.lang.time.DateFormatUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - - -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - -@RestController -public class OrderService { - - - private List orders = Arrays.asList( - - new Order(1, 1, "A101", "2020/02/14"), - new Order(2, 1, "A101", "2020/02/14"), - new Order(3, 2, "A150", "2020/02/17")); - - @GetMapping - public List getAllOrders() { - return orders; - } - - @GetMapping("/{id}") - public List getOrdersByCustomer(@PathVariable int id) { - return orders.stream() - .filter(order -> order.getCustomerId() == id).collect(Collectors.toList()); - } - - @PostMapping("/create") - public OrderResponse createOrder(@RequestBody OrderDTO request) { - - int lastIndex = orders.size(); - Order order = new Order(); - order.setId(lastIndex + 1); - order.setCustomerId(request.getCustomerId()); - order.setItemId(request.getItemId()); - String date = DateFormatUtils.format(new Date(), "yyyy/MM/dd"); - order.setDate(date); - - return new OrderResponse(order.getId(), order.getItemId(), "CREATED"); - } - -} diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/resources/application.properties b/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/resources/application.properties deleted file mode 100644 index f4fe5e7079..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/main/resources/application.properties +++ /dev/null @@ -1,4 +0,0 @@ -#Spring Boot server configuration -server.servlet.context-path=/order-service -server.port=8002 - diff --git a/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/test/java/com/baeldung/orderservice/OrderServiceTest.java b/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/test/java/com/baeldung/orderservice/OrderServiceTest.java deleted file mode 100644 index 2630f908be..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/order-server/src/test/java/com/baeldung/orderservice/OrderServiceTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.baeldung.orderservice; - -import com.baeldung.paymentservice.PaymentClient; -import com.baeldung.paymentservice.PaymentDTO; -import com.baeldung.paymentservice.PaymentResponse; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = OrderApplication.class) -public class OrderServiceTest { - - @Autowired - private PaymentClient paymentClient; - - - @Test - public void testSendPaySuccess(){ - - - PaymentDTO dto = new PaymentDTO("Sasa","Milenkovic","4260-6720-3283-7081",150.0,"USD"); - - PaymentResponse response = paymentClient.pay("A152", dto); - - Assert.assertNotNull("Payment Id not generated", response.getPaymentId()); - Assert.assertEquals("CREDITCARD", response.getPaymentMethod()); - Assert.assertEquals("Sasa Milenkovic", response.getCustomerFullName()); - Assert.assertEquals(new Double(150.0), response.getAmount()); - Assert.assertEquals("USD", response.getCurrency()); - } -} diff --git a/spring-boot-modules/spring-boot-microservices/order-service/pom.xml b/spring-boot-modules/spring-boot-microservices/order-service/pom.xml deleted file mode 100644 index fcdfdac595..0000000000 --- a/spring-boot-modules/spring-boot-microservices/order-service/pom.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - CustomerOrderApp - com.baeldung - 1.0-SNAPSHOT - - 4.0.0 - - com.baeldung.orderservice - order-service - pom - - order-client - order-server - - - - 1.8 - 2.6 - 0.0.2 - 1.8 - 1.8 - UTF-8 - com.baeldung.orderservice.OrderApplication - - - - - - org.springframework.boot - spring-boot-dependencies - 2.3.0.RELEASE - pom - import - - - - - - - org.springframework.boot - spring-boot-starter-web - - - commons-lang - commons-lang - ${commons-lang.version} - - - org.qunix - structure-maven-plugin - ${structure-maven.version} - - - org.springframework.boot - spring-boot-starter-json - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-configuration-processor - - - org.springframework.boot - spring-boot-test-autoconfigure - test - - - junit - junit - test - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - ${orderservice.mainclass} - - - - - repackage - - - exe - - - - start-application - - com.baeldung.orderservice.OrderApplication - ../order-server/target/classes - - - start - - - - - - org.qunix - structure-maven-plugin - ${structure-maven.version} - false - - - compile - - modules - - - - - - - - diff --git a/spring-boot-modules/spring-boot-microservices/pom.xml b/spring-boot-modules/spring-boot-microservices/pom.xml deleted file mode 100644 index 774a1080ec..0000000000 --- a/spring-boot-modules/spring-boot-microservices/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - com.baeldung - CustomerOrderApp - pom - 1.0-SNAPSHOT - CustomerOrderApp - http://maven.apache.org - - - org.springframework.boot - spring-boot-starter-parent - 2.3.0.RELEASE - - - - - UTF-8 - 1.8 - 1.8 - - - - customer-service - order-service - shared-dto - - - - - org.projectlombok - lombok - true - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-autoconfigure - - - diff --git a/spring-boot-modules/spring-boot-microservices/postman/customer-order.postman_collection b/spring-boot-modules/spring-boot-microservices/postman/customer-order.postman_collection deleted file mode 100644 index 6f7fd9d35a..0000000000 --- a/spring-boot-modules/spring-boot-microservices/postman/customer-order.postman_collection +++ /dev/null @@ -1,59 +0,0 @@ -{ - "info": { - "_postman_id": "92594398-49cc-4a7c-b44f-1037307afbd3", - "name": "postman-requests", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "Crete new Customer order", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "multipart/form-data", - "type": "text", - "disabled": true - }, - { - "key": "Accept-Charset", - "value": "utf-8", - "type": "text", - "disabled": true - }, - { - "key": "boundary", - "value": "nAp4nMEt-BuGuuLlq-6fnASQErGjSamaG", - "type": "text", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"customerId\":2,\n \"itemId\":\"A152\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:8001/customer-service/order", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "8001", - "path": [ - "customer-service", - "order" - ] - } - }, - "response": [] - } - - ], - "protocolProfileBehavior": {} -} \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-microservices/shared-dto/pom.xml b/spring-boot-modules/spring-boot-microservices/shared-dto/pom.xml deleted file mode 100644 index d61a5bb34b..0000000000 --- a/spring-boot-modules/spring-boot-microservices/shared-dto/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - CustomerOrderApp - com.baeldung - 1.0-SNAPSHOT - - 4.0.0 - - com.baeldung - shared-dto - - shared-dto - - - - UTF-8 - 1.8 - 1.8 - 0.0.2 - - - - - org.qunix - structure-maven-plugin - ${structure-maven.version} - - - - - - - - org.qunix - structure-maven-plugin - ${structure-maven.version} - false - - - compile - - files - - - - - - - - diff --git a/spring-boot-modules/spring-boot-microservices/shared-dto/src/main/java/com/baeldung/CustomerDTO.java b/spring-boot-modules/spring-boot-microservices/shared-dto/src/main/java/com/baeldung/CustomerDTO.java deleted file mode 100644 index 549a0dbaf0..0000000000 --- a/spring-boot-modules/spring-boot-microservices/shared-dto/src/main/java/com/baeldung/CustomerDTO.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.baeldung.paymentservice; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class CustomerDTO { - - private String firstName; - private String lastName; - private String homeAddress; - private String cardNumber; - -} diff --git a/spring-boot-modules/spring-boot-microservices/shared-dto/src/main/java/com/baeldung/OrderDTO.java b/spring-boot-modules/spring-boot-microservices/shared-dto/src/main/java/com/baeldung/OrderDTO.java deleted file mode 100644 index c31c9f6bec..0000000000 --- a/spring-boot-modules/spring-boot-microservices/shared-dto/src/main/java/com/baeldung/OrderDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.orderservice.client; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class OrderDTO { - - private int customerId; - private String itemId; - -} diff --git a/spring-boot-modules/spring-boot-microservices/src/main/java/com/baeldung/CustomerOrderApp.java b/spring-boot-modules/spring-boot-microservices/src/main/java/com/baeldung/CustomerOrderApp.java deleted file mode 100644 index 15455ca16c..0000000000 --- a/spring-boot-modules/spring-boot-microservices/src/main/java/com/baeldung/CustomerOrderApp.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -/** - * Customer Order Spring Boot Main Application - * - * */ - -@SpringBootApplication -@ComponentScan(basePackages = "com.baeldung.*") -public class CustomerOrderApp -{ - - public static void main( String[] args ) - { - - SpringApplication.run(CustomerOrderApp.class,args); - - } -}