shiori/model/model.go

41 lines
1.4 KiB
Go
Raw Normal View History

package model
2018-02-03 21:20:10 +08:00
// Tag is tag for the bookmark
type Tag struct {
2018-05-19 23:43:15 +08:00
ID int `db:"id" json:"id"`
2018-03-10 11:39:38 +08:00
Name string `db:"name" json:"name"`
2018-05-19 23:43:15 +08:00
NBookmarks int `db:"n_bookmarks" json:"nBookmarks"`
2018-03-10 11:39:38 +08:00
Deleted bool `json:"-"`
}
2018-02-03 21:20:10 +08:00
// Bookmark is record of a specified URL
type Bookmark struct {
2018-05-19 23:43:15 +08:00
ID int `db:"id" json:"id"`
2018-03-06 17:48:06 +08:00
URL string `db:"url" json:"url"`
Title string `db:"title" json:"title"`
ImageURL string `db:"image_url" json:"imageURL"`
Excerpt string `db:"excerpt" json:"excerpt"`
Author string `db:"author" json:"author"`
MinReadTime int `db:"min_read_time" json:"minReadTime"`
MaxReadTime int `db:"max_read_time" json:"maxReadTime"`
Modified string `db:"modified" json:"modified"`
Content string `db:"content" json:"-"`
2018-05-22 21:13:28 +08:00
HTML string `db:"html" json:"html,omitempty"`
2018-05-19 14:36:51 +08:00
HasContent bool `db:"has_content" json:"hasContent"`
2018-03-06 17:48:06 +08:00
Tags []Tag `json:"tags"`
}
2018-02-20 17:48:02 +08:00
// Account is account for accessing bookmarks from web interface
type Account struct {
2018-05-19 23:43:15 +08:00
ID int `db:"id" json:"id"`
2018-02-20 17:48:02 +08:00
Username string `db:"username" json:"username"`
Password string `db:"password" json:"password"`
}
2018-02-22 17:48:36 +08:00
// LoginRequest is login request
type LoginRequest struct {
Username string `json:"username"`
Password string `json:"password"`
Remember bool `json:"remember"`
}