Class DummyVendorController
java.lang.Object
com.minicrm.mini_crm_api.controllers.DummyVendorController
This controller simulates an external vendor API for sending messages.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleSendMessage(Map<String, String> payload) The core logic of the vendor simulation.org.springframework.http.ResponseEntity<String>The public-facing API endpoint that simulates receiving a message request from our application.
-
Constructor Details
-
DummyVendorController
public DummyVendorController()
-
-
Method Details
-
send
@PostMapping("/send") public org.springframework.http.ResponseEntity<String> send(@RequestBody Map<String, String> payload) The public-facing API endpoint that simulates receiving a message request from our application.- Parameters:
payload- A map containing message details, including the `logId`.- Returns:
- A ResponseEntity with HTTP status 202 Accepted.
-
handleSendMessage
The core logic of the vendor simulation. This method contains the simulation of delivery success/failure and triggers the asynchronous callback to our webhook.- Parameters:
payload- The message payload containing the `logId`.
-