feat(im): add DingTalk platform integration

Add DingTalk bot adapter supporting both webhook (HmacSHA256 signature
verification) and Stream mode (via official dingtalk-stream-sdk-go),
with sessionWebhook/OpenAPI reply fallback and AccessToken caching.
This commit is contained in:
nullkey
2026-03-24 16:48:34 +08:00
committed by lyingbug
parent aea0a97be3
commit a1a384ec67
14 changed files with 605 additions and 8 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ import (
)
// validIMPlatforms is the set of supported IM platforms.
var validIMPlatforms = map[string]bool{"wecom": true, "feishu": true, "slack": true, "telegram": true}
var validIMPlatforms = map[string]bool{"wecom": true, "feishu": true, "slack": true, "telegram": true, "dingtalk": true}
// IMHandler handles IM platform callback requests and channel CRUD.
type IMHandler struct {
@@ -57,7 +57,7 @@ func (h *IMHandler) CreateIMChannel(c *gin.Context) {
}
if !validIMPlatforms[req.Platform] {
c.JSON(http.StatusBadRequest, gin.H{"error": "platform must be 'wecom', 'feishu', 'slack' or 'telegram'"})
c.JSON(http.StatusBadRequest, gin.H{"error": "platform must be 'wecom', 'feishu', 'slack', 'telegram' or 'dingtalk'"})
return
}