refactor: remove ExternalSource and ExternalID from Conversation model and related services, update references to use ChannelID instead

This commit is contained in:
mlogclub
2026-04-27 19:04:10 +08:00
parent 24105781d9
commit b3ef55b04e
21 changed files with 183 additions and 136 deletions
+3 -3
View File
@@ -19,8 +19,6 @@ func BuildConversation(item *models.Conversation) response.ConversationResponse
AIAgentID: item.AIAgentID,
ChannelID: item.ChannelID,
CustomerID: item.CustomerID,
ExternalSource: item.ExternalSource,
ExternalID: item.ExternalID,
Subject: item.Subject,
Status: item.Status,
ServiceMode: item.ServiceMode,
@@ -38,11 +36,13 @@ func BuildConversation(item *models.Conversation) response.ConversationResponse
AgentLastReadMessageID: readStateMessageID(agentReadState),
AgentLastReadSeqNo: readStateSeqNo(agentReadState),
AgentLastReadAt: readStateAt(agentReadState),
CustomerOnline: services.WsService.IsGuestOnline(item.ExternalID),
ClosedAt: utils.FormatTimePtr(item.ClosedAt),
ClosedBy: item.ClosedBy,
CloseReason: item.CloseReason,
}
if identity := services.ConversationService.GetConversationExternalIdentity(item); identity != nil {
ret.CustomerOnline = services.WsService.IsGuestOnline(identity.ExternalID)
}
if item.CurrentAssigneeID > 0 {
if user := services.UserService.Get(item.CurrentAssigneeID); user != nil {
ret.CurrentAssigneeName = user.Nickname