feat: 迁移预警规则管理和历史分类查询
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
package business
|
||||
|
||||
import "time"
|
||||
|
||||
type alertRulePO struct {
|
||||
ID uint64 `gorm:"primaryKey"`
|
||||
RuleName string `gorm:"size:100;not null"`
|
||||
RuleType string `gorm:"size:50;not null"`
|
||||
MonitorMetric int `gorm:"type:tinyint;not null"`
|
||||
StatPeriodDays *int `gorm:"type:int"`
|
||||
MomDirection *int `gorm:"type:tinyint"`
|
||||
MomThreshold *string `gorm:"type:decimal(7,2)"`
|
||||
UnloginDays *int `gorm:"type:int"`
|
||||
MonitorScope int `gorm:"type:tinyint;not null;default:1"`
|
||||
WarningColor string `gorm:"size:20;not null"`
|
||||
CreatorID uint `gorm:"index;not null"`
|
||||
Enabled int `gorm:"type:tinyint;not null;default:1"`
|
||||
IsDeleted int `gorm:"type:tinyint;not null;default:0"`
|
||||
CreatedAt, UpdatedAt time.Time
|
||||
}
|
||||
|
||||
func (alertRulePO) TableName() string { return "sys_alert_rule" }
|
||||
|
||||
type alertRecordPO struct {
|
||||
ID uint64 `gorm:"primaryKey"`
|
||||
PlatformCode, PlatformName string `gorm:"size:50"`
|
||||
RuleID uint64
|
||||
RuleName string `gorm:"size:100"`
|
||||
RuleType string `gorm:"size:50"`
|
||||
MonitorMetric *int
|
||||
TargetPromoteID uint64
|
||||
TargetPromoteName string `gorm:"size:100"`
|
||||
BusinessID uint `gorm:"index"`
|
||||
BusinessName string `gorm:"size:100"`
|
||||
AlertContent string `gorm:"type:text"`
|
||||
Status int `gorm:"type:tinyint;default:1;index"`
|
||||
AlertDate *time.Time `gorm:"type:date"`
|
||||
CreatedAt, UpdatedAt time.Time
|
||||
}
|
||||
|
||||
func (alertRecordPO) TableName() string { return "sys_alert_record" }
|
||||
|
||||
type alertLogPO struct {
|
||||
ID uint64 `gorm:"primaryKey"`
|
||||
AlertID uint64 `gorm:"index"`
|
||||
OperatorID uint
|
||||
OperatorName string `gorm:"size:50"`
|
||||
LogType int
|
||||
ActionDetail string `gorm:"size:100"`
|
||||
NoteContent string `gorm:"type:text"`
|
||||
AttachmentIDs *string `gorm:"type:json"`
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
func (alertLogPO) TableName() string { return "sys_alert_operation_log" }
|
||||
Reference in New Issue
Block a user