-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
establishing communication with Order microservice
- Loading branch information
1 parent
9641b16
commit 599bf48
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
payment/src/main/java/payment/api/clients/OrderClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
34
payment/src/main/java/payment/api/dto/OrderUpdateRequestDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
|