diff --git a/admin-service/src/main/java/com/nashtech/controller/ReactiveDataController.java b/admin-service/src/main/java/com/nashtech/controller/ReactiveDataController.java index 454bd993..cf3f3f5e 100644 --- a/admin-service/src/main/java/com/nashtech/controller/ReactiveDataController.java +++ b/admin-service/src/main/java/com/nashtech/controller/ReactiveDataController.java @@ -8,7 +8,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.http.codec.ServerSentEvent; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -16,8 +15,6 @@ import org.springframework.web.bind.annotation.RestController; import reactor.core.publisher.Flux; -import java.util.Map; - /** * Rest Controller class * which handles reactive data access for cars. @@ -70,25 +67,6 @@ public Flux getCarsByBrand( return reactiveDataService.getCarsByBrand(brand); } - /** - * Retrieves a stream of cars with the given brand. - * The data is obtained using the reactive service and duplicates - * are filtered out. - * - * @param brand The brand of cars to filter by. - * @return A Flux of Car representing cars with the - * specified brand. - */ - @Operation(summary = "Retrieves cars filtered by brand.", - description = "The data is obtained using the reactive service" - + " and duplicates are filtered out.") - @GetMapping(value = "/cars-sse/{brand}", produces = - MediaType.TEXT_EVENT_STREAM_VALUE) - public Flux getCarsByBrandSse( - @PathVariable final String brand) { - return reactiveDataService.getCarsByBrand(brand); - } - /** * Retrieves a stream of distinct car brands. * The data is obtained using the reactive service and duplicates are @@ -104,27 +82,4 @@ public Flux getCarsByBrandSse( public Flux getAllBrands() { return reactiveDataService.getAllBrands(); } - - - /** - * Retrieves a stream of distinct car brands. - * - * The data is obtained using the reactive service and duplicates are - * filtered out. - * - * @return A Flux of CarBrand representing distinct car brands. - */ - @Operation(summary = "Retrieves unique car brands.", - description = "The data is obtained using the reactive" - + " service and duplicates are filtered out.") - @GetMapping(value = "/brands-sse", - produces = MediaType.TEXT_EVENT_STREAM_VALUE) - public Flux>> getAllBrandsSSE() { - return reactiveDataService.getAllBrandsSse() - .map(eventData -> ServerSentEvent.>builder() - .data(eventData.data()) - .build()); - } - - }