Class DummyVendorController

java.lang.Object
com.minicrm.mini_crm_api.controllers.DummyVendorController

@RestController @RequestMapping("/vendor/api") public class DummyVendorController extends Object
This controller simulates an external vendor API for sending messages.
  • 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

      public void handleSendMessage(Map<String,String> payload)
      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`.