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.

47 lines
1.6 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. SortByFictionalDate bool `bson:"sortByFictionalDate"`
  17. }
  18. // IsChangeObject is an interface implementation to identify it as a valid
  19. // ChangeObject in GQL.
  20. func (*Story) IsChangeObject() {
  21. panic("this method is a dummy, and so is its caller")
  22. }
  23. type StoryFilter struct {
  24. Author *string
  25. Tags []Tag
  26. EarliestFictionalDate time.Time
  27. LatestFictionalDate time.Time
  28. Category *StoryCategory
  29. Open *bool
  30. Unlisted *bool
  31. Limit int
  32. }
  33. type StoryUpdate struct {
  34. Name *string
  35. Category *StoryCategory
  36. Author *string
  37. Open *bool
  38. Listed *bool
  39. FictionalDate *time.Time
  40. UpdatedDate *time.Time
  41. SortByFictionalDate *bool
  42. }