fix: harden real backend workflows and channel connections

This commit is contained in:
hectorzhao
2026-07-06 17:54:53 +08:00
parent 8cca361441
commit b5132d7f4e
47 changed files with 2530 additions and 314 deletions
+29 -4
View File
@@ -7,10 +7,11 @@ const SchemaVersion = "v1"
type MessageType string
const (
MessageTypeSubmitCommand MessageType = "SubmitCommand"
MessageTypeSubmitResult MessageType = "SubmitResult"
MessageTypeReceiptEvent MessageType = "ReceiptEvent"
MessageTypeUplinkEvent MessageType = "UplinkEvent"
MessageTypeSubmitCommand MessageType = "SubmitCommand"
MessageTypeSubmitResult MessageType = "SubmitResult"
MessageTypeReceiptEvent MessageType = "ReceiptEvent"
MessageTypeUplinkEvent MessageType = "UplinkEvent"
MessageTypeConnectChannel MessageType = "ConnectChannel"
)
type Envelope struct {
@@ -88,3 +89,27 @@ type UplinkEvent struct {
Content string `json:"content"`
ReceivedAt time.Time `json:"receivedAt"`
}
type ConnectChannelCommand struct {
SchemaVersion string `json:"schemaVersion"`
MessageType MessageType `json:"messageType"`
TraceID string `json:"traceId"`
ChannelID string `json:"channelId"`
ConnectionID string `json:"connectionId"`
CreatedAt time.Time `json:"createdAt"`
Reason string `json:"reason"`
DesiredConnections int `json:"desiredConnections"`
Channel ConnectChannelConfig `json:"channel"`
}
type ConnectChannelConfig struct {
Code string `json:"code"`
Name string `json:"name"`
GatewayHost string `json:"gatewayHost"`
GatewayPort int `json:"gatewayPort"`
Account string `json:"account"`
PasswordCipher string `json:"passwordCipher"`
SrcID string `json:"srcId"`
CMPPVersion string `json:"cmppVersion"`
RateLimitPerSecond int `json:"rateLimitPerSecond"`
}