From ac432c14247c762048f598ff03e4ac27ce94e3f7 Mon Sep 17 00:00:00 2001 From: Anton Bondar Date: Mon, 3 Jul 2023 14:03:36 +0300 Subject: [PATCH 1/2] remove default 200 OK response --- .../java/greencity/controller/AddressController.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/greencity/controller/AddressController.java b/core/src/main/java/greencity/controller/AddressController.java index 10c21f2cf..23c7419fd 100644 --- a/core/src/main/java/greencity/controller/AddressController.java +++ b/core/src/main/java/greencity/controller/AddressController.java @@ -15,15 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PatchMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import javax.validation.Valid; @@ -66,6 +58,7 @@ public ResponseEntity getAllAddressesForCurrentUs @ApiResponse(code = 401, message = HttpStatuses.UNAUTHORIZED), @ApiResponse(code = 404, message = HttpStatuses.NOT_FOUND) }) + @ResponseStatus(HttpStatus.CREATED) @PostMapping("/save-order-address") public ResponseEntity saveAddressForOrder( @Valid @RequestBody CreateAddressRequestDto dtoRequest, From 7ba910e82161b932e135fa4ad01bdec5107551d5 Mon Sep 17 00:00:00 2001 From: Anton Bondar Date: Mon, 3 Jul 2023 14:26:07 +0300 Subject: [PATCH 2/2] imports --- .../java/greencity/controller/AddressController.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/greencity/controller/AddressController.java b/core/src/main/java/greencity/controller/AddressController.java index 23c7419fd..921d9c1f4 100644 --- a/core/src/main/java/greencity/controller/AddressController.java +++ b/core/src/main/java/greencity/controller/AddressController.java @@ -15,7 +15,16 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; import javax.validation.Valid;