feat: cbs message enhance

This commit is contained in:
zhangsz
2025-07-15 16:26:21 +08:00
parent f43adfdf6f
commit 81177be0ca
12 changed files with 147 additions and 36 deletions

View File

@@ -86,6 +86,7 @@ func (m *CBMessage) List(c *gin.Context) {
"neId": msg.NeId,
"messageJson": messageJson, // 这里是解析后的 JSON 对象
"status": msg.Status.Enum(),
"detail": msg.Detail,
"createdAt": msg.CreatedAt,
"updatedAt": msg.UpdatedAt,
}
@@ -274,6 +275,7 @@ func (m *CBMessage) GetById(c *gin.Context) {
"neId": data.NeId,
"messageJson": messageJson, // 这里是解析后的 JSON 对象
"status": data.Status.Enum(),
"detail": data.Detail,
"createdAt": data.CreatedAt,
"updatedAt": data.UpdatedAt,
}

View File

@@ -76,6 +76,7 @@ type CBMessage struct {
NeId string `json:"neId" gorm:"column:ne_id"` // 网元ID
MessageJson json.RawMessage `json:"messageJson" gorm:"column:message_json"` // 消息内容JSON
Status CBEventStatus `json:"status" gorm:"column:status"` // 消息状态
Detail string `json:"detail" gorm:"column:detail"` // 详情
CreatedAt int64 `json:"createdAt" gorm:"column:created_at"` // 创建时间
UpdatedAt *int64 `json:"updatedAt" gorm:"column:updated_at;autoUpdateTime:false"` // 更新时间
}