GraphQL API and utilities for the rpdata project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4 KiB

  1. package models
  2. import "time"
  3. // A Story is user content that does not have a wiki-suitable format. Documents, new stories, short stories, and so on.
  4. // The story model is a container for multiple chapters this time, in contrast to the previous version.
  5. type Story struct {
  6. ID string `bson:"_id"`
  7. Author string `bson:"author"`
  8. Name string `bson:"name"`
  9. Category StoryCategory `bson:"category"`
  10. Open bool `bson:"open"`
  11. Listed bool `bson:"listed"`
  12. Tags []Tag `bson:"tags"`
  13. CreatedDate time.Time `bson:"createdDate"`
  14. FictionalDate time.Time `bson:"fictionalDate,omitempty"`
  15. UpdatedDate time.Time `bson:"updatedDate"`
  16. }
  17. // IsChangeObject is an interface implementation to identify it as a valid
  18. // ChangeObject in GQL.
  19. func (*Story) IsChangeObject() {
  20. panic("this method is a dummy, and so is its caller")
  21. }
  22. type StoryFilter struct {
  23. Author *string
  24. Tags []Tag
  25. EarliestFictionalDate time.Time
  26. LatestFictionalDate time.Time
  27. Category *StoryCategory
  28. Open *bool
  29. Unlisted *bool
  30. Limit int
  31. }
  32. type StoryUpdate struct {
  33. Name *string
  34. Category *StoryCategory
  35. Author *string
  36. Open *bool
  37. Listed *bool
  38. FictionalDate *time.Time
  39. UpdatedDate *time.Time
  40. }