50 lines
2.7 KiB
Go
50 lines
2.7 KiB
Go
package model
|
||
|
||
// KpiTitle 指标标题信息对象 kpi_title
|
||
type KpiTitle struct {
|
||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||
NeType string `json:"neType" gorm:"column:ne_type"` // 网元类型
|
||
KpiId string `json:"kpiId" gorm:"column:kpi_id"` // KPI标识
|
||
TitleJson string `json:"titleJson" gorm:"column:title_json"`
|
||
CnTitle string `json:"cnTitle" gorm:"column:cn_title"` // 中文名
|
||
EnTitle string `json:"enTitle" gorm:"column:en_title"` // 英文名
|
||
StatusFlag string `json:"statusFlag" gorm:"column:status_flag"` // 状态标识 1:启用 0:禁用
|
||
}
|
||
|
||
// TableName 表名称
|
||
func (*KpiTitle) TableName() string {
|
||
return "kpi_title"
|
||
}
|
||
|
||
// KpiReport 指标报表信息对象
|
||
type KpiReport struct {
|
||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||
CoreUID string `json:"coreUid" gorm:"column:core_uid"` // 核心网唯一标识
|
||
NeUID string `json:"neUid" gorm:"column:ne_uid"` // 网元唯一标识
|
||
NeType string `json:"neType" gorm:"column:ne_type"` // 网元类型
|
||
Date string `json:"date" gorm:"column:date"` // Date of the report yyyy-mm-dd hh:mi:ss
|
||
StartTime string `json:"startTime" gorm:"column:start_time"` // Start time of the report hh:mi:ss
|
||
EndTime string `json:"endTime" gorm:"column:end_time"` // End time of the report hh:mi:ss
|
||
Index int64 `json:"index" gorm:"column:index"` // Index of the report
|
||
Granularity int64 `json:"granularity" gorm:"column:granularity"` // Time granualarity: 5/10/.../60/300 (second)
|
||
KpiValues string `json:"kpiValues" gorm:"column:kpi_values"` // KPI values JSON String
|
||
CreatedAt int64 `json:"createdAt" gorm:"column:created_at"` // Creation time 接收到的timestamp秒级存储毫秒时间戳
|
||
}
|
||
|
||
// TableName 表名称
|
||
func (*KpiReport) TableName() string {
|
||
return "kpi_report"
|
||
}
|
||
|
||
// KPIQuery 指标查询参数结构体
|
||
type KPIQuery struct {
|
||
CoreUID string `json:"coreUid" form:"coreUid" binding:"required"` // 核心网唯一标识
|
||
NeUID string `json:"neUid" form:"neUid" binding:"required"` // 网元唯一标识
|
||
NeType string `json:"neType" form:"neType" binding:"required"` // 网元类型
|
||
BeginTime int64 `form:"beginTime" binding:"required"` // 开始时间戳(毫秒)1739361200999
|
||
EndTime int64 `form:"endTime" binding:"required"` // 结束时间戳(毫秒)1739361210088
|
||
Interval int64 `form:"interval" binding:"required,oneof=5 60 300 900 1800 3600"`
|
||
SortField string `form:"sortField" binding:"omitempty,oneof=timeGroup"`
|
||
SortOrder string `form:"sortOrder" binding:"omitempty,oneof=asc desc"`
|
||
}
|