feat(webhook): dispatch persisted provider events

This commit is contained in:
2026-06-05 00:12:04 +08:00
parent 66ecabb984
commit 06b999becd
10 changed files with 178 additions and 44 deletions
+3 -2
View File
@@ -12,6 +12,7 @@ import (
"io"
"net/http"
"github.com/gochat/gochat/internal/channel"
linechannel "github.com/gochat/gochat/internal/channel/line"
"github.com/gochat/gochat/internal/model"
channelmodel "github.com/gochat/gochat/internal/model/channel"
@@ -31,13 +32,13 @@ type LineWebhookHandler struct {
}
// NewLineWebhookHandler creates a LINE webhook handler for Gin integration.
func NewLineWebhookHandler(lineWebhook *linechannel.WebhookHandler, pipeline *linechannel.IncomingProcessor, service *linechannel.LineService, db *gorm.DB) *LineWebhookHandler {
func NewLineWebhookHandler(lineWebhook *linechannel.WebhookHandler, pipeline *linechannel.IncomingProcessor, service *linechannel.LineService, db *gorm.DB, dispatcher ...*channel.Dispatcher) *LineWebhookHandler {
return &LineWebhookHandler{
lineWebhook: lineWebhook,
pipeline: pipeline,
service: service,
db: db,
persister: NewIncomingPersister(db),
persister: NewIncomingPersister(db, dispatcher...),
}
}