entry.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. Content string `json:"content"`
  29. Author string `json:"author"`
  30. ShareCode string `json:"share_code"`
  31. Starred bool `json:"starred"`
  32. ReadingTime int `json:"reading_time"`
  33. Enclosures EnclosureList `json:"enclosures"`
  34. Feed *Feed `json:"feed,omitempty"`
  35. }
  36. // Entries represents a list of entries.
  37. type Entries []*Entry
  38. // EntriesStatusUpdateRequest represents a request to change entries status.
  39. type EntriesStatusUpdateRequest struct {
  40. EntryIDs []int64 `json:"entry_ids"`
  41. Status string `json:"status"`
  42. }