From bc543e9c79f33db2a671a2555fede3dd842ebe38 Mon Sep 17 00:00:00 2001 From: sanitaso Date: Tue, 8 Mar 2022 15:13:42 +0100 Subject: [PATCH] remove dir --- .../SwaggerResponseApiApplication.java | 13 ------- .../controller/ProductController.java | 38 ------------------- .../swaggerresponseapi/model/Product.java | 28 -------------- .../service/ProductService.java | 21 ---------- 4 files changed, 100 deletions(-) delete mode 100644 spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/SwaggerResponseApiApplication.java delete mode 100644 spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/controller/ProductController.java delete mode 100644 spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/model/Product.java delete mode 100644 spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/service/ProductService.java diff --git a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/SwaggerResponseApiApplication.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/SwaggerResponseApiApplication.java deleted file mode 100644 index 913544b459..0000000000 --- a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/SwaggerResponseApiApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.swaggerresponseapi; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class SwaggerResponseApiApplication { - - public static void main(String[] args) { - SpringApplication.run(SwaggerResponseApiApplication.class, args); - } - -} diff --git a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/controller/ProductController.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/controller/ProductController.java deleted file mode 100644 index 364a7e8a66..0000000000 --- a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/controller/ProductController.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.baeldung.swaggerresponseapi.controller; - -import com.baeldung.swaggerresponseapi.model.Product; -import com.baeldung.swaggerresponseapi.service.ProductService; - -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@RestController -public class ProductController { - private final ProductService productService; - - public ProductController(ProductService productService) { - this.productService = productService; - } - - @PostMapping("/create") - public Product addProduct(@RequestBody Product product) { - return productService.addProducts(product); - } - - @ApiResponses(value = { @ApiResponse(content = { @Content(mediaType = "application/json", - array = @ArraySchema(schema = @Schema(implementation = Product.class))) }) }) - @GetMapping("/products") - public List getProductsList() { - return productService.getProductsList(); - } -} diff --git a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/model/Product.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/model/Product.java deleted file mode 100644 index 036ecbc853..0000000000 --- a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/model/Product.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.baeldung.swaggerresponseapi.model; - -public class Product { - String code; - String name; - - public Product(String code, String name) { - this.code = code; - this.name = name; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} - diff --git a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/service/ProductService.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/service/ProductService.java deleted file mode 100644 index 5e7533d6f4..0000000000 --- a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/swaggerresponseapi/service/ProductService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.baeldung.swaggerresponseapi.service; - -import com.baeldung.swaggerresponseapi.model.Product; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; - -@Service -public class ProductService { - List productsList = new ArrayList<>(); - - public Product addProducts(Product product) { - productsList.add(product); - return product; - } - - public List getProductsList() { - return productsList; - } -}