alert_state.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package models
  2. // type AlertState struct {
  3. // Id int64 `json:"-"`
  4. // OrgId int64 `json:"-"`
  5. // AlertId int64 `json:"alertId"`
  6. // State string `json:"state"`
  7. // Created time.Time `json:"created"`
  8. // Info string `json:"info"`
  9. // TriggeredAlerts *simplejson.Json `json:"triggeredAlerts"`
  10. // }
  11. //
  12. // func (this *UpdateAlertStateCommand) IsValidState() bool {
  13. // for _, v := range alertstates.ValidStates {
  14. // if this.State == v {
  15. // return true
  16. // }
  17. // }
  18. // return false
  19. // }
  20. //
  21. // // Commands
  22. //
  23. // type UpdateAlertStateCommand struct {
  24. // AlertId int64 `json:"alertId" binding:"Required"`
  25. // OrgId int64 `json:"orgId" binding:"Required"`
  26. // State string `json:"state" binding:"Required"`
  27. // Info string `json:"info"`
  28. //
  29. // Result *Alert
  30. // }
  31. //
  32. // // Queries
  33. //
  34. // type GetAlertsStateQuery struct {
  35. // OrgId int64 `json:"orgId" binding:"Required"`
  36. // AlertId int64 `json:"alertId" binding:"Required"`
  37. //
  38. // Result *[]AlertState
  39. // }
  40. //
  41. // type GetLastAlertStateQuery struct {
  42. // AlertId int64
  43. // OrgId int64
  44. //
  45. // Result *AlertState
  46. // }