entry.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright 2017 Frédéric Guillot. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package model // import "miniflux.app/model"
  5. import (
  6. "time"
  7. )
  8. // Entry statuses and default sorting order.
  9. const (
  10. EntryStatusUnread = "unread"
  11. EntryStatusRead = "read"
  12. EntryStatusRemoved = "removed"
  13. DefaultSortingOrder = "published_at"
  14. DefaultSortingDirection = "asc"
  15. )
  16. // Entry represents a feed item in the system.
  17. type Entry struct {
  18. ID int64 `json:"id"`
  19. UserID int64 `json:"user_id"`
  20. FeedID int64 `json:"feed_id"`
  21. Status string `json:"status"`
  22. Hash string `json:"hash"`
  23. Title string `json:"title"`
  24. URL string `json:"url"`
  25. CommentsURL string `json:"comments_url"`
  26. Date time.Time `json:"published_at"`
  27. CreatedAt time.Time `json:"created_at"`
  28. ChangedAt time.Time `json:"changed_at"`
  29. Content string `json:"content"`
  30. Author string `json:"author"`
  31. ShareCode string `json:"share_code"`
  32. Starred bool `json:"starred"`
  33. ReadingTime int `json:"reading_time"`
  34. Enclosures EnclosureList `json:"enclosures"`
  35. Feed *Feed `json:"feed,omitempty"`
  36. }
  37. // Entries represents a list of entries.
  38. type Entries []*Entry
  39. // EntriesStatusUpdateRequest represents a request to change entries status.
  40. type EntriesStatusUpdateRequest struct {
  41. EntryIDs []int64 `json:"entry_ids"`
  42. Status string `json:"status"`
  43. }