数据实体模型
This commit is contained in:
@@ -2,32 +2,42 @@ package model
|
||||
|
||||
import "time"
|
||||
|
||||
// Alarm 实时告警上报信息
|
||||
type Alarm struct {
|
||||
Id int
|
||||
AlarmSeq int
|
||||
AlarmId string
|
||||
NeId string
|
||||
AlarmCode int
|
||||
AlarmTitle string
|
||||
EventTime time.Time
|
||||
AlarmType string
|
||||
OrigSeverity string
|
||||
PVFlag string
|
||||
NeName string
|
||||
NeType string
|
||||
ObjectName string
|
||||
ObjectUID string
|
||||
ObjectType string
|
||||
LocationInfo string
|
||||
Province string
|
||||
AlarmStatus int
|
||||
SpecificProblem string
|
||||
SpecificProblemID string
|
||||
AddInfo string
|
||||
ClearType int
|
||||
ClearTime time.Time
|
||||
ID int64 `json:"id" gorm:"id"`
|
||||
AlarmSeq int64 `json:"alarm_seq" gorm:"alarm_seq"`
|
||||
AlarmId string `json:"alarm_id" gorm:"alarm_id"`
|
||||
AlarmTitle string `json:"alarm_title" gorm:"alarm_title"`
|
||||
NeType string `json:"ne_type" gorm:"ne_type"`
|
||||
NeId string `json:"ne_id" gorm:"ne_id"`
|
||||
AlarmCode int64 `json:"alarm_code" gorm:"alarm_code"`
|
||||
EventTime time.Time `json:"event_time" gorm:"event_time"`
|
||||
AlarmType string `json:"alarm_type" gorm:"alarm_type"`
|
||||
OrigSeverity string `json:"orig_severity" gorm:"orig_severity"` // 1: Critical, 2: Major, 3: Minor, 4: Warning, 5: Event(Only VNF)
|
||||
PerceivedSeverity string `json:"perceived_severity" gorm:"perceived_severity"` // 1: Critical, 2: Major, 3: Minor, 4: Warning, 5: Event(Only VNF)
|
||||
PvFlag string `json:"pv_flag" gorm:"pv_flag"`
|
||||
NeName string `json:"ne_name" gorm:"ne_name"`
|
||||
ObjectUid string `json:"object_uid" gorm:"object_uid"`
|
||||
ObjectName string `json:"object_name" gorm:"object_name"`
|
||||
ObjectType string `json:"object_type" gorm:"object_type"`
|
||||
LocationInfo string `json:"location_info" gorm:"location_info"`
|
||||
Province string `json:"province" gorm:"province"`
|
||||
AlarmStatus int64 `json:"alarm_status" gorm:"alarm_status"`
|
||||
SpecificProblem string `json:"specific_problem" gorm:"specific_problem"`
|
||||
SpecificProblemId string `json:"specific_problem_id" gorm:"specific_problem_id"`
|
||||
AddInfo string `json:"add_info" gorm:"add_info"`
|
||||
Counter int64 `json:"counter" gorm:"counter"`
|
||||
LatestEventTime time.Time `json:"latest_event_time" gorm:"latest_event_time"`
|
||||
AckState int8 `json:"ack_state" gorm:"ack_state"` // 0: Unacked, 1: Acked
|
||||
AckTime time.Time `json:"ack_time" gorm:"ack_time"`
|
||||
AckUser string `json:"ack_user" gorm:"ack_user"`
|
||||
ClearType int8 `json:"clear_type" gorm:"clear_type"` // 0: Unclear, 1: AutoClear, 2: ManualClear
|
||||
ClearTime time.Time `json:"clear_time" gorm:"clear_time"`
|
||||
ClearUser string `json:"clear_user" gorm:"clear_user"`
|
||||
Timestamp time.Time `json:"timestamp" gorm:"timestamp"`
|
||||
}
|
||||
|
||||
func (Alarm) TableName() string {
|
||||
// TableName 表名称
|
||||
func (*Alarm) TableName() string {
|
||||
return "alarm"
|
||||
}
|
||||
|
||||
@@ -2,20 +2,23 @@ package model
|
||||
|
||||
import "time"
|
||||
|
||||
// NbiAlarmLog undefined
|
||||
type NbiAlarmLog struct {
|
||||
ID int64
|
||||
AId int64
|
||||
OpUser string
|
||||
SrcIp string
|
||||
NeType string
|
||||
NeId string
|
||||
AlarmSeq int64
|
||||
AlarmId string
|
||||
AlarmCode int
|
||||
EventTime time.Time
|
||||
LogTime time.Time
|
||||
ID int64 `json:"id" gorm:"id"`
|
||||
OpUser string `json:"op_user" gorm:"op_user"`
|
||||
SrcIp string `json:"src_ip" gorm:"src_ip"`
|
||||
NeType string `json:"ne_type" gorm:"ne_type"`
|
||||
NeId string `json:"ne_id" gorm:"ne_id"`
|
||||
AlarmSeq int64 `json:"alarm_seq" gorm:"alarm_seq"`
|
||||
AlarmId string `json:"alarm_id" gorm:"alarm_id"`
|
||||
AlarmCode int64 `json:"alarm_code" gorm:"alarm_code"`
|
||||
AlarmStatus int64 `json:"alarm_status" gorm:"alarm_status"` // 0/1: 清除告警/活动告警
|
||||
EventTime string `json:"event_time" gorm:"event_time"`
|
||||
LogTime time.Time `json:"log_time" gorm:"log_time"`
|
||||
AId int64 `json:"a_id" gorm:"a_id"`
|
||||
}
|
||||
|
||||
func (NbiAlarmLog) TableName() string {
|
||||
// TableName 表名称
|
||||
func (*NbiAlarmLog) TableName() string {
|
||||
return "nbi_alarm_log"
|
||||
}
|
||||
|
||||
25
handle/model/omc_alarm.go
Normal file
25
handle/model/omc_alarm.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package model
|
||||
|
||||
// OmcAlarm 告警上报的结构体信息
|
||||
type OmcAlarm struct {
|
||||
AlarmSeq int64 `json:"alarmSeq"` //告警序列号
|
||||
AlarmTitle string `json:"alarmTitle"` //告警事件标题
|
||||
AlarmStatus int64 `json:"alarmStatus"` //告警状态
|
||||
AlarmType string `json:"alarmType"` //告警类型
|
||||
OrigSeverity int64 `json:"origSeverity"` //原始级别
|
||||
EventTime string `json:"eventTime"` //事件发生时间
|
||||
AlarmId string `json:"alarmId"` //告警事件唯一标识
|
||||
SpecificProblemID string `json:"specificProblemID"` //告警问题原因ID
|
||||
SpecificProblem string `json:"specificProblem"` //告警问题原因
|
||||
NeUID string `json:"neUID"` //告警网元UID
|
||||
NeName string `json:"neName"` //告警网元名称
|
||||
NeType string `json:"neType"` //告警网元设备类型
|
||||
ObjectUID string `json:"objectUID"` //告警定位对象UID
|
||||
ObjectName string `json:"objectName"` //告警定位对象名称
|
||||
ObjectType string `json:"objectType"` //告警定位对象资源类型
|
||||
LocationInfo string `json:"locationInfo"` //告警定位信息
|
||||
AddInfo string `json:"addInfo"` //告警辅助信息[条件必选]
|
||||
PVFlag string `json:"PVFlag"` //网元虚实性[条件必选]
|
||||
Province string `json:"province"` //网元服务省份
|
||||
Unit string `json:"unit"` //网元服务省份
|
||||
}
|
||||
@@ -2,38 +2,40 @@ package model
|
||||
|
||||
import "time"
|
||||
|
||||
// 用户表实体信息
|
||||
// User 用户表实体信息
|
||||
type User struct {
|
||||
Id int `json:"id"`
|
||||
AccountId string `json:"account_id"`
|
||||
Name string `json:"name"`
|
||||
RealName string `json:"real_name"`
|
||||
Sn string `json:"sn"`
|
||||
Gender string `json:"gender"`
|
||||
Email string `json:"email"`
|
||||
IdCardNumber string `json:"id_card_number"`
|
||||
Description string `json:"description"`
|
||||
TelephoneNumber string `json:"telephone_number"`
|
||||
Phone string `json:"phone"`
|
||||
Mobile string `json:"mobile"`
|
||||
EmployeeNumber string `json:"employee_number"`
|
||||
EmployeeType string `json:"employee_type"`
|
||||
Organize string `json:"organize"`
|
||||
SupporterCorpName string `json:"supporter_corp_name"`
|
||||
StartTime time.Time `json:"start_time"`
|
||||
EndTime time.Time `json:"end_time"`
|
||||
Password string `json:"password"`
|
||||
PasswordSha512 string `json:"password_sha512"`
|
||||
ChangePasswordFlag int `json:"change_password_flag"`
|
||||
PasswordExpiration string `json:"password_expiration"`
|
||||
Status string `json:"status"`
|
||||
UserExpiration string `json:"user_expiration"`
|
||||
GroupName string `json:"group_name"`
|
||||
Profile string `json:"profile"`
|
||||
CreateTime time.Time `json:"create_time"`
|
||||
UpdateTime time.Time `json:"update_time"`
|
||||
ID int64 `json:"id" gorm:"id"`
|
||||
AccountId string `json:"account_id" gorm:"account_id"`
|
||||
Name string `json:"name" gorm:"name"`
|
||||
RealName string `json:"real_name" gorm:"real_name"`
|
||||
Sn string `json:"sn" gorm:"sn"`
|
||||
Gender string `json:"gender" gorm:"gender"`
|
||||
Email string `json:"email" gorm:"email"`
|
||||
IdCardNumber string `json:"id_card_number" gorm:"id_card_number"`
|
||||
Description string `json:"description" gorm:"description"`
|
||||
TelephoneNumber string `json:"telephone_number" gorm:"telephone_number"`
|
||||
Phone string `json:"phone" gorm:"phone"`
|
||||
Mobile string `json:"mobile" gorm:"mobile"`
|
||||
EmployeeNumber string `json:"employee_number" gorm:"employee_number"`
|
||||
EmployeeType string `json:"employee_type" gorm:"employee_type"`
|
||||
Organize string `json:"organize" gorm:"organize"`
|
||||
SupporterCorpName string `json:"supporter_corp_name" gorm:"supporter_corp_name"`
|
||||
StartTime string `json:"start_time" gorm:"start_time"`
|
||||
EndTime string `json:"end_time" gorm:"end_time"`
|
||||
Password string `json:"password" gorm:"password"`
|
||||
PasswordSha512 string `json:"password_sha512" gorm:"password_sha512"`
|
||||
ChangePasswordFlag int8 `json:"change_password_flag" gorm:"change_password_flag"`
|
||||
PasswordExpiration time.Time `json:"password_expiration" gorm:"password_expiration"`
|
||||
Status string `json:"status" gorm:"status"`
|
||||
UserExpiration time.Time `json:"user_expiration" gorm:"user_expiration"`
|
||||
GroupName string `json:"group_name" gorm:"group_name"`
|
||||
Profile string `json:"profile" gorm:"profile"`
|
||||
CreateTime time.Time `json:"create_time" gorm:"create_time"`
|
||||
UpdateTime time.Time `json:"update_time" gorm:"update_time"`
|
||||
Unit string `json:"unit" gorm:"unit"`
|
||||
}
|
||||
|
||||
func (User) TableName() string {
|
||||
// TableName 表名称
|
||||
func (*User) TableName() string {
|
||||
return "user"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user