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.

48 lines
1.1 KiB

  1. package models
  2. import (
  3. "github.com/gofrs/uuid"
  4. )
  5. type Post struct {
  6. Base
  7. Title string `gorm:"not null"`
  8. Content string `gorm:"not null"`
  9. FrontPage bool `gorm:"not null"`
  10. Order int `gorm:"not null"`
  11. }
  12. type PostLinkType string
  13. const (
  14. POST_LINK_FACEBOOK PostLinkType = "Facebook"
  15. POST_LINK_INSTAGRAM PostLinkType = "Instagram"
  16. POST_LINK_YOUTUBE PostLinkType = "YouTube"
  17. POST_LINK_SPOTIFY PostLinkType = "Spotify"
  18. POST_LINK_OTHER PostLinkType = "Other"
  19. )
  20. type PostLink struct {
  21. Base
  22. PostId uuid.UUID `gorm:"type:uuid;column:post_foreign_key;not null;"`
  23. Link string `gorm:"not null"`
  24. Type PostLinkType `gorm:"not null"`
  25. }
  26. type PostImage struct {
  27. Base
  28. PostId uuid.UUID `gorm:"type:uuid;column:post_foreign_key;not null;"`
  29. Filepath string `gorm:"not null"`
  30. }
  31. type PostVideo struct {
  32. Base
  33. PostId uuid.UUID `gorm:"type:uuid;column:post_foreign_key;not null;"`
  34. Filepath string `gorm:"not null"`
  35. }
  36. type PostAudio struct {
  37. Base
  38. PostId uuid.UUID `gorm:"type:uuid;column:post_foreign_key;not null;"`
  39. Filepath string `gorm:"not null"`
  40. }