ot_monitor_rules.go 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package models
  2. import (
  3. "go-admin/common/models"
  4. )
  5. type OtMonitorRules struct {
  6. models.Model
  7. Kind string `json:"kind" gorm:"type:varchar(32);comment:所属分类:trace,metric,log"`
  8. Group string `json:"group" gorm:"type:varchar(64);comment:子类型,聚类筛选,可自添加"`
  9. Name string `json:"name" gorm:"type:varchar(128);comment:事件项名称,不可重复"`
  10. MonitorAlias string `json:"monitorAlias" gorm:"type:varchar(64);comment:监控项别名"`
  11. DataSource string `json:"dataSource" gorm:"type:varchar(11);comment:数据源"`
  12. Table string `json:"table" gorm:"type:varchar(32);comment:表名"`
  13. ValueType string `json:"valueType" gorm:"type:varchar(32);comment:值类型"`
  14. Expression string `json:"expression" gorm:"type:varchar(2048);comment:表达式"`
  15. Interval int64 `json:"interval" gorm:"type:int(11);comment:探测周期"`
  16. Verify int64 `json:"verify" gorm:"type:tinyint(1);comment:是否验证成功"`
  17. Power int64 `json:"power" gorm:"type:tinyint(1);comment:是否启用"`
  18. models.ModelTime
  19. models.ControlBy
  20. }
  21. type OtMRAndAP struct {
  22. models.Model
  23. Kind string `json:"kind" gorm:"type:varchar(32);comment:所属分类:trace,metric,log"`
  24. Group string `json:"group" gorm:"type:varchar(64);comment:子类型,聚类筛选,可自添加"`
  25. Name string `json:"name" gorm:"type:varchar(128);comment:事件项名称,不可重复"`
  26. MonitorAlias string `json:"monitorAlias" gorm:"type:varchar(64);comment:监控项别名"`
  27. DataSource string `json:"dataSource" gorm:"type:varchar(11);comment:数据源"`
  28. Table string `json:"table" gorm:"type:varchar(32);comment:表名"`
  29. ValueType string `json:"valueType" gorm:"type:varchar(32);comment:值类型"`
  30. Expression string `json:"expression" gorm:"type:varchar(2048);comment:表达式"`
  31. Interval int64 `json:"interval" gorm:"type:int(11);comment:探测周期"`
  32. Verify int64 `json:"verify" gorm:"type:tinyint(1);comment:是否验证成功"`
  33. Power int64 `json:"power" gorm:"type:tinyint(1);comment:是否启用"`
  34. PolicyId int64 `json:"policy_id" gorm:"type:bigint(20)"`
  35. AppId int64 `json:"app_id" gorm:"type:bigint(20)"`
  36. RuleId int64 `json:"rule_id" gorm:"type:bigint(20)"`
  37. Policy string `json:"policy" gorm:"type:varchar(256)"`
  38. ApPower int64 `json:"ap_power" gorm:"type:tinyint(1)"`
  39. models.ModelTime
  40. models.ControlBy
  41. }
  42. func (OtMonitorRules) TableName() string {
  43. return "ot_monitor_rules"
  44. }
  45. func (e *OtMonitorRules) Generate() models.ActiveRecord {
  46. o := *e
  47. return &o
  48. }
  49. func (e *OtMonitorRules) GetId() interface{} {
  50. return e.Id
  51. }