schedule.go 987 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package publish
  2. import (
  3. "time"
  4. )
  5. // @snippet_begin(PublishSchedule)
  6. type Schedule struct {
  7. ScheduledStartAt *time.Time `gorm:"index"`
  8. ScheduledEndAt *time.Time `gorm:"index"`
  9. ActualStartAt *time.Time
  10. ActualEndAt *time.Time
  11. }
  12. // @snippet_end
  13. func (schedule Schedule) GetScheduledStartAt() *time.Time {
  14. return schedule.ScheduledStartAt
  15. }
  16. func (schedule Schedule) GetScheduledEndAt() *time.Time {
  17. return schedule.ScheduledEndAt
  18. }
  19. func (schedule *Schedule) SetScheduledStartAt(v *time.Time) {
  20. schedule.ScheduledStartAt = v
  21. }
  22. func (schedule *Schedule) SetScheduledEndAt(v *time.Time) {
  23. schedule.ScheduledEndAt = v
  24. }
  25. func (schedule Schedule) GetPublishedAt() *time.Time {
  26. return schedule.ActualStartAt
  27. }
  28. func (schedule Schedule) GetUnPublishedAt() *time.Time {
  29. return schedule.ActualEndAt
  30. }
  31. func (schedule *Schedule) SetPublishedAt(v *time.Time) {
  32. schedule.ActualStartAt = v
  33. }
  34. func (schedule *Schedule) SetUnPublishedAt(v *time.Time) {
  35. schedule.ActualEndAt = v
  36. }