event.go 533 B

1234567891011121314151617181920212223242526272829
  1. package models
  2. import "gorm.io/gorm"
  3. type EventStatus int64
  4. const (
  5. EventStatusSuccess EventStatus = 1
  6. EventStatusInProgress = 2
  7. EventStatusFailed = 3
  8. )
  9. type EventContainer struct {
  10. gorm.Model
  11. Steps []SubEvent
  12. }
  13. type SubEvent struct {
  14. gorm.Model
  15. EventContainerID uint
  16. EventID string // events with the same id wil be treated the same, and the highest index one is retained
  17. Name string
  18. Index int64 // priority of the event, used for sorting
  19. Status EventStatus
  20. Info string
  21. }