Skip to content

Commit

Permalink
establishing communication with Order microservice
Browse files Browse the repository at this point in the history
  • Loading branch information
eya-cherif committed Dec 20, 2024
1 parent 9641b16 commit 599bf48
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
21 changes: 21 additions & 0 deletions payment/src/main/java/payment/api/clients/OrderClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package payment.api.clients;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import payment.api.dto.OrderUpdateRequestDTO;

@RegisterRestClient(baseUri = "http://localhost:8084/")
@Path("/orders")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface OrderClient {
@POST
@Path("/update-status")
Response updateOrderStatus(OrderUpdateRequestDTO orderUpdateRequestDTO);
}
34 changes: 34 additions & 0 deletions payment/src/main/java/payment/api/dto/OrderUpdateRequestDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package payment.api.dto;

import java.util.UUID;

public class OrderUpdateRequestDTO {

private UUID orderId;
private String newStatus;

public OrderUpdateRequestDTO() {}

public OrderUpdateRequestDTO(UUID orderId, String newStatus) {
this.orderId = orderId;
this.newStatus = newStatus;
}


public UUID getOrderId() {
return orderId;
}

public void setOrderId(UUID orderId) {
this.orderId = orderId;
}

public String getNewStatus() {
return newStatus;
}

public void setNewStatus(String newStatus) {
this.newStatus = newStatus;
}
}

0 comments on commit 599bf48

Please sign in to comment.