entry.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package model // import "miniflux.app/v2/internal/model"
  4. import (
  5. "time"
  6. )
  7. // Entry statuses and default sorting order.
  8. const (
  9. EntryStatusUnread = "unread"
  10. EntryStatusRead = "read"
  11. EntryStatusRemoved = "removed"
  12. DefaultSortingOrder = "published_at"
  13. DefaultSortingDirection = "asc"
  14. )
  15. // Entry represents a feed item in the system.
  16. type Entry struct {
  17. ID int64 `json:"id"`
  18. UserID int64 `json:"user_id"`
  19. FeedID int64 `json:"feed_id"`
  20. Status string `json:"status"`
  21. Hash string `json:"hash"`
  22. Title string `json:"title"`
  23. URL string `json:"url"`
  24. CommentsURL string `json:"comments_url"`
  25. Date time.Time `json:"published_at"`
  26. CreatedAt time.Time `json:"created_at"`
  27. ChangedAt time.Time `json:"changed_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. Tags []string `json:"tags"`
  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. }