feat(channels): add Shangwutong connector

This commit is contained in:
2026-08-03 10:13:40 +08:00
parent 96f5c796a6
commit 897b4e018f
126 changed files with 20207 additions and 272 deletions
@@ -12,6 +12,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/gochat/gochat/internal/llm"
"github.com/gochat/gochat/internal/middleware"
"github.com/gochat/gochat/internal/model"
"github.com/gochat/gochat/internal/service"
"github.com/gochat/gochat/pkg/pagination"
@@ -345,7 +346,11 @@ func (h *ConversationHandler) ToggleStatus(c *gin.Context) {
if !ok {
return
}
conversation, svcErr := h.conversationSvc.ToggleStatus(c.Request.Context(), accountID, conversation.ID, req)
if !requireConnectorShangwutongConversation(c, h.conversationSvc.DB(), conversation) {
return
}
requestContext := service.WithShangwutongRequestMetadata(c.Request.Context(), middleware.IsConnectorService(c), currentUserID(c))
conversation, svcErr := h.conversationSvc.ToggleStatus(requestContext, accountID, conversation.ID, req)
if svcErr != nil {
handleServiceError(c, svcErr)
return
@@ -828,6 +833,9 @@ func (h *ConversationHandler) UpdateCustomAttributes(c *gin.Context) {
if !ok {
return
}
if !requireConnectorShangwutongConversation(c, h.conversationSvc.DB(), conversation) {
return
}
conversation, svcErr := h.conversationSvc.UpdateCustomAttributes(c.Request.Context(), accountID, conversation.ID, req.CustomAttributes)
if svcErr != nil {
handleServiceError(c, svcErr)