Class DingTalkCallbackController

java.lang.Object
io.agentscope.extensions.channel.dingtalk.DingTalkCallbackController

@RestController @RequestMapping("/api/channels/dingtalk") public class DingTalkCallbackController extends Object
Handles inbound bot message delivery (POST) for DingTalk channels running in http callback mode.

Each DingTalkChannel registers itself with the controller at start-up; the controller dispatches incoming requests by channelId extracted from the URL path. This avoids Spring-side dynamic mapping registration and keeps wiring trivially testable.

  • Constructor Details

    • DingTalkCallbackController

      public DingTalkCallbackController()
  • Method Details

    • dispatch

      @PostMapping(value="/{channelId}/callback", consumes="application/json", produces="text/plain") public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<String>> dispatch(@PathVariable String channelId, @RequestHeader(value="timestamp",required=false) String timestamp, @RequestHeader(value="sign",required=false) String sign, @RequestBody String body)
      Inbound bot message. DingTalk POSTs the bot-message JSON to this endpoint with timestamp/sign headers; when the robot is configured with an aesKey the body is a {"encrypt": ...} envelope instead. The message is verified, decrypted when needed, and handed to the channel's shared intake pipeline (msgId dedup, mapping, bot-loop guard, dispatch). Always returns 200 so DingTalk does not retry, unless the signature is invalid, the body is unusable, or the channel is unknown.