2023-06-19 17:42:47 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2017-11-20 00:10:04 -05:00
|
|
|
|
2018-08-25 00:51:50 -04:00
|
|
|
package model // import "miniflux.app/model"
|
2017-11-20 00:10:04 -05:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2021-01-04 18:32:32 -05:00
|
|
|
// Entry statuses and default sorting order.
|
2017-11-20 00:10:04 -05:00
|
|
|
const (
|
|
|
|
EntryStatusUnread = "unread"
|
|
|
|
EntryStatusRead = "read"
|
|
|
|
EntryStatusRemoved = "removed"
|
|
|
|
DefaultSortingOrder = "published_at"
|
2017-12-02 20:04:01 -05:00
|
|
|
DefaultSortingDirection = "asc"
|
2017-11-20 00:10:04 -05:00
|
|
|
)
|
|
|
|
|
2017-11-21 18:46:59 -05:00
|
|
|
// Entry represents a feed item in the system.
|
2017-11-20 00:10:04 -05:00
|
|
|
type Entry struct {
|
2018-04-07 16:50:45 -04:00
|
|
|
ID int64 `json:"id"`
|
|
|
|
UserID int64 `json:"user_id"`
|
|
|
|
FeedID int64 `json:"feed_id"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Hash string `json:"hash"`
|
|
|
|
Title string `json:"title"`
|
|
|
|
URL string `json:"url"`
|
2018-04-07 16:56:11 -04:00
|
|
|
CommentsURL string `json:"comments_url"`
|
2018-04-07 16:50:45 -04:00
|
|
|
Date time.Time `json:"published_at"`
|
2020-11-29 20:04:18 -05:00
|
|
|
CreatedAt time.Time `json:"created_at"`
|
2021-05-26 01:13:38 -04:00
|
|
|
ChangedAt time.Time `json:"changed_at"`
|
2018-04-07 16:50:45 -04:00
|
|
|
Content string `json:"content"`
|
|
|
|
Author string `json:"author"`
|
2019-10-05 07:30:25 -04:00
|
|
|
ShareCode string `json:"share_code"`
|
2018-04-07 16:50:45 -04:00
|
|
|
Starred bool `json:"starred"`
|
2020-11-18 20:29:40 -05:00
|
|
|
ReadingTime int `json:"reading_time"`
|
2021-01-04 18:32:32 -05:00
|
|
|
Enclosures EnclosureList `json:"enclosures"`
|
2018-04-07 16:50:45 -04:00
|
|
|
Feed *Feed `json:"feed,omitempty"`
|
2023-02-24 23:52:45 -05:00
|
|
|
Tags []string `json:"tags"`
|
2017-11-20 00:10:04 -05:00
|
|
|
}
|
|
|
|
|
2017-11-21 18:46:59 -05:00
|
|
|
// Entries represents a list of entries.
|
2017-11-20 00:10:04 -05:00
|
|
|
type Entries []*Entry
|
|
|
|
|
2021-01-04 18:32:32 -05:00
|
|
|
// EntriesStatusUpdateRequest represents a request to change entries status.
|
|
|
|
type EntriesStatusUpdateRequest struct {
|
|
|
|
EntryIDs []int64 `json:"entry_ids"`
|
|
|
|
Status string `json:"status"`
|
2017-11-26 18:07:59 -05:00
|
|
|
}
|