BAEL-7272: Fixed based on review comments

This commit is contained in:
balasr3 2024-01-21 20:17:19 +00:00
parent e5e668ef13
commit d7d7c1ea54
2 changed files with 5 additions and 54 deletions

View File

@ -23,13 +23,13 @@ public class OrderController {
}
@GetMapping(value = "v1/order/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public Mono<OrderResponse> searchOrderV1(@PathVariable(value = "id") int id) {
public final Mono<OrderResponse> searchOrderV1(@PathVariable(value = "id") int id) {
return externalServiceV1.findById(id)
.bodyToMono(OrderResponse.class);
}
@GetMapping(value = "v2/order/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public Mono<OrderResponse> searchOrderV2(@PathVariable(value = "id") int id) {
public final Mono<OrderResponse> searchOrderV2(@PathVariable(value = "id") int id) {
return externalServiceV2.findById(id)
.bodyToMono(OrderResponse.class);
}

View File

@ -4,22 +4,11 @@ import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;
import lombok.Data;
@Data
public class OrderResponse {
public OrderResponse(UUID orderId, LocalDateTime orderDateTime, List<String> address, List<String> orderNotes) {
this.orderId = orderId;
this.orderDateTime = orderDateTime;
this.address = address;
this.orderNotes = orderNotes;
}
public OrderResponse() {
this.orderId = null;
this.orderDateTime = null;
this.address = null;
this.orderNotes = null;
}
private UUID orderId;
private LocalDateTime orderDateTime;
@ -27,42 +16,4 @@ public class OrderResponse {
private List<String> address;
private List<String> orderNotes;
public UUID getOrderId() {
return orderId;
}
public void setOrderId(UUID orderId) {
this.orderId = orderId;
}
public LocalDateTime getOrderDateTime() {
return orderDateTime;
}
public void setOrderDate(LocalDateTime orderDateTime) {
this.orderDateTime = orderDateTime;
}
public List<String> getAddress() {
return address;
}
public void setAddress(List<String> address) {
this.address = address;
}
public List<String> getOrderNotes() {
return orderNotes;
}
public void setOrderNotes(List<String> orderNotes) {
this.orderNotes = orderNotes;
}
@Override
public String toString() {
return "OrderResponse{" + "orderId=" + orderId + ", orderDateTime=" + orderDateTime + ", address=" + address + ", orderNotes=" + orderNotes + '}';
}
}