fix: track live downstream cmpp connections
This commit is contained in:
@@ -40,6 +40,7 @@ model Tenant {
|
||||
smsUplinkMessages SmsUplinkMessage[]
|
||||
smsUplinkMatchCandidates SmsUplinkMatchCandidate[]
|
||||
cmppDownstreamDeliveries CmppDownstreamDelivery[]
|
||||
cmppDownstreamConnections CmppDownstreamConnection[]
|
||||
cmppConnectionStates CmppConnectionState[]
|
||||
gatewayDownstreamRecoveryStatuses GatewayDownstreamRecoveryStatus[]
|
||||
gatewaySubmitDeadLetters GatewaySubmitDeadLetter[]
|
||||
@@ -371,6 +372,7 @@ model SmsApplication {
|
||||
uplinkMessages SmsUplinkMessage[]
|
||||
uplinkMatchCandidates SmsUplinkMatchCandidate[]
|
||||
downstreamDeliveries CmppDownstreamDelivery[]
|
||||
downstreamConnections CmppDownstreamConnection[]
|
||||
connectionStates CmppConnectionState[]
|
||||
gatewayDownstreamRecoveryStatuses GatewayDownstreamRecoveryStatus[]
|
||||
gatewaySubmitDeadLetters GatewaySubmitDeadLetter[]
|
||||
@@ -550,6 +552,33 @@ model CmppConnectionState {
|
||||
@@index([channelId, status])
|
||||
}
|
||||
|
||||
model CmppDownstreamConnection {
|
||||
id String @id @default(cuid())
|
||||
tenantId String
|
||||
applicationId String
|
||||
account String
|
||||
enterpriseCode String
|
||||
connectionId String @unique
|
||||
remoteIp String?
|
||||
protocol String?
|
||||
status String @default("connected")
|
||||
connectedAt DateTime @default(now())
|
||||
lastHeartbeatAt DateTime?
|
||||
lastSubmitAt DateTime?
|
||||
lastDeliverAt DateTime?
|
||||
disconnectedAt DateTime?
|
||||
lastError String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||
application SmsApplication @relation(fields: [applicationId], references: [id])
|
||||
|
||||
@@index([applicationId, status, updatedAt])
|
||||
@@index([tenantId, status, updatedAt])
|
||||
@@index([account, status])
|
||||
}
|
||||
|
||||
model SmsChannelGroup {
|
||||
id String @id @default(cuid())
|
||||
code String @unique
|
||||
|
||||
Reference in New Issue
Block a user