feat(channels): add Shangwutong connector
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user