1
0
Fork 0
miniflux/model/entry.go

50 lines
1.6 KiB
Go
Raw Normal View History

2017-11-19 21:10:04 -08:00
// Copyright 2017 Frédéric Guillot. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
2018-08-24 21:51:50 -07:00
package model // import "miniflux.app/model"
2017-11-19 21:10:04 -08:00
import (
"time"
)
2021-01-04 15:32:32 -08:00
// Entry statuses and default sorting order.
2017-11-19 21:10:04 -08:00
const (
EntryStatusUnread = "unread"
EntryStatusRead = "read"
EntryStatusRemoved = "removed"
DefaultSortingOrder = "published_at"
2017-12-02 17:04:01 -08:00
DefaultSortingDirection = "asc"
2017-11-19 21:10:04 -08:00
)
2017-11-21 15:46:59 -08:00
// Entry represents a feed item in the system.
2017-11-19 21:10:04 -08:00
type Entry struct {
2018-04-07 21:50:45 +01: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"`
CommentsURL string `json:"comments_url"`
2018-04-07 21:50:45 +01:00
Date time.Time `json:"published_at"`
2020-11-29 17:04:18 -08:00
CreatedAt time.Time `json:"created_at"`
ChangedAt time.Time `json:"changed_at"`
2018-04-07 21:50:45 +01:00
Content string `json:"content"`
Author string `json:"author"`
ShareCode string `json:"share_code"`
2018-04-07 21:50:45 +01:00
Starred bool `json:"starred"`
ReadingTime int `json:"reading_time"`
2021-01-04 15:32:32 -08:00
Enclosures EnclosureList `json:"enclosures"`
2018-04-07 21:50:45 +01:00
Feed *Feed `json:"feed,omitempty"`
2017-11-19 21:10:04 -08:00
}
2017-11-21 15:46:59 -08:00
// Entries represents a list of entries.
2017-11-19 21:10:04 -08:00
type Entries []*Entry
2021-01-04 15:32:32 -08:00
// EntriesStatusUpdateRequest represents a request to change entries status.
type EntriesStatusUpdateRequest struct {
EntryIDs []int64 `json:"entry_ids"`
Status string `json:"status"`
2017-11-26 15:07:59 -08:00
}