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
5package model // import "miniflux.app/model"
6
7import (
8	"time"
9)
10
11// Entry statuses and default sorting order.
12const (
13	EntryStatusUnread       = "unread"
14	EntryStatusRead         = "read"
15	EntryStatusRemoved      = "removed"
16	DefaultSortingOrder     = "published_at"
17	DefaultSortingDirection = "asc"
18)
19
20// Entry represents a feed item in the system.
21type Entry struct {
22	ID          int64         `json:"id"`
23	UserID      int64         `json:"user_id"`
24	FeedID      int64         `json:"feed_id"`
25	Status      string        `json:"status"`
26	Hash        string        `json:"hash"`
27	Title       string        `json:"title"`
28	URL         string        `json:"url"`
29	CommentsURL string        `json:"comments_url"`
30	Date        time.Time     `json:"published_at"`
31	CreatedAt   time.Time     `json:"created_at"`
32	ChangedAt   time.Time     `json:"changed_at"`
33	Content     string        `json:"content"`
34	Author      string        `json:"author"`
35	ShareCode   string        `json:"share_code"`
36	Starred     bool          `json:"starred"`
37	ReadingTime int           `json:"reading_time"`
38	Enclosures  EnclosureList `json:"enclosures"`
39	Feed        *Feed         `json:"feed,omitempty"`
40}
41
42// Entries represents a list of entries.
43type Entries []*Entry
44
45// EntriesStatusUpdateRequest represents a request to change entries status.
46type EntriesStatusUpdateRequest struct {
47	EntryIDs []int64 `json:"entry_ids"`
48	Status   string  `json:"status"`
49}
50