Files
be.ems/src/modules/ne_data/model/alarm.go
TsMask 45e226ce1a Refactor API tags in swagger.yaml to use shortened prefixes
- Updated tags from 'network_data' to 'ne_data' for consistency and brevity.
- Changed 'network_element' to 'ne' across various endpoints for improved readability.
- Adjusted related descriptions in the tags section to reflect the new naming conventions.
2025-08-21 14:30:09 +08:00

58 lines
4.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
// Alarm 告警记录
type Alarm struct {
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
NeType string `json:"neType" gorm:"column:ne_type"` // 网元类型
NeId string `json:"neId" gorm:"column:ne_id"` // 网元ID
NeName string `json:"neName" gorm:"column:ne_name"` // 网元名称
Province string `json:"province" gorm:"column:province"` // 网元省份地域
PvFlag string `json:"pvFlag" gorm:"column:pv_flag"` // 网元标识虚拟化标识
AlarmSeq int64 `json:"alarmSeq" gorm:"column:alarm_seq"` // 告警序号 连续递增
AlarmId string `json:"alarmId" gorm:"column:alarm_id"` // 告警ID
AlarmTitle string `json:"alarmTitle" gorm:"column:alarm_title"` // 告警标题
AlarmCode int64 `json:"alarmCode" gorm:"column:alarm_code"` // 告警状态码
EventTime int64 `json:"eventTime" gorm:"column:event_time"` // 事件产生时间
AlarmType string `json:"alarmType" gorm:"column:alarm_type"` // 告警类型
OrigSeverity string `json:"origSeverity" gorm:"column:orig_severity"` // 严重程度
PerceivedSeverity string `json:"perceivedSeverity" gorm:"column:perceived_severity"` // 告警级别
ObjectUid string `json:"objectUid" gorm:"column:object_uid"` // 对象ID
ObjectName string `json:"objectName" gorm:"column:object_name"` // 对象名称
ObjectType string `json:"objectType" gorm:"column:object_type"` // 对象类型
LocationInfo string `json:"locationInfo" gorm:"column:location_info"` // 告警定位信息
AlarmStatus string `json:"alarmStatus" gorm:"column:alarm_status"` // 告警状态
SpecificProblem string `json:"specificProblem" gorm:"column:specific_problem"` // 告警问题原因
SpecificProblemId string `json:"specificProblemId" gorm:"column:specific_problem_id"` // 告警问题原因ID
AddInfo string `json:"addInfo" gorm:"column:add_info"` // 告警辅助信息
AckState string `json:"ackState" gorm:"column:ack_state"` // 确认状态
AckTime int64 `json:"ackTime" gorm:"column:ack_time"` // 确认时间
AckUser string `json:"ackUser" gorm:"column:ack_user"` // 确认用户
ClearType string `json:"clearType" gorm:"column:clear_type"` // 清除状态
ClearTime int64 `json:"clearTime" gorm:"column:clear_time"` // 清除时间
ClearUser string `json:"clearUser" gorm:"column:clear_user"` // 清除用户
Timestamp int64 `json:"timestamp" gorm:"column:timestamp"` // 创建时间
}
// TableName 表名称
func (*Alarm) TableName() string {
return "alarm"
}
// AlarmQuery 告警数据查询参数结构体
type AlarmQuery struct {
NeType string `json:"neType" form:"neType"` // 网元类型
NeID string `json:"neId" form:"neId"` // 网元ID
NeName string `json:"neName" form:"neName"`
PvFlag string `json:"pvFlag" form:"pvFlag"`
AlarmCode string `json:"alarmCode" form:"alarmCode"`
AlarmType string `json:"alarmType" form:"alarmType"`
AlarmStatus string `json:"alarmStatus" form:"alarmStatus" binding:"omitempty,oneof=Clear Active"` // 告警状态
OrigSeverity string `json:"origSeverity" form:"origSeverity"` // 告警类型
BeginTime int64 `json:"beginTime" form:"beginTime"` // 开始时间 查event_time
EndTime int64 `json:"endTime" form:"endTime"`
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=event_time id"` // 排序字段,填写结果字段
SortOrder string `json:"sortOrder" form:"sortOrder" binding:"omitempty,oneof=asc desc"` // 排序升降序asc desc
PageNum int64 `json:"pageNum" form:"pageNum" binding:"required"`
PageSize int64 `json:"pageSize" form:"pageSize" binding:"required"`
}