2019-05-21 11:31:40 +08:00
|
|
|
package model
|
|
|
|
|
|
|
|
// Tag is the tag for a bookmark.
|
|
|
|
type Tag struct {
|
|
|
|
ID int `db:"id" json:"id"`
|
|
|
|
Name string `db:"name" json:"name"`
|
2019-05-22 00:24:11 +08:00
|
|
|
NBookmarks int `db:"n_bookmarks" json:"nBookmarks,omitempty"`
|
2019-05-21 11:31:40 +08:00
|
|
|
Deleted bool `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Bookmark is the record for an URL.
|
|
|
|
type Bookmark struct {
|
2019-06-11 11:59:08 +08:00
|
|
|
ID int `db:"id" json:"id"`
|
|
|
|
URL string `db:"url" json:"url"`
|
|
|
|
Title string `db:"title" json:"title"`
|
|
|
|
Excerpt string `db:"excerpt" json:"excerpt"`
|
|
|
|
Author string `db:"author" json:"author"`
|
|
|
|
Modified string `db:"modified" json:"modified"`
|
|
|
|
Content string `db:"content" json:"-"`
|
|
|
|
HTML string `db:"html" json:"html,omitempty"`
|
|
|
|
HasContent bool `db:"has_content" json:"hasContent"`
|
2019-08-05 23:06:00 +08:00
|
|
|
HasArchive bool `json:"hasArchive"`
|
2019-06-11 11:59:08 +08:00
|
|
|
ImageURL string `json:"imageURL"`
|
|
|
|
Tags []Tag `json:"tags"`
|
|
|
|
CreateArchive bool `json:"createArchive"`
|
2019-05-21 11:31:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Account is person that allowed to access web interface.
|
|
|
|
type Account struct {
|
|
|
|
ID int `db:"id" json:"id"`
|
|
|
|
Username string `db:"username" json:"username"`
|
2019-05-31 23:41:29 +08:00
|
|
|
Password string `db:"password" json:"password,omitempty"`
|
2019-05-21 11:31:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// LoginRequest is request from user to access web interface.
|
|
|
|
type LoginRequest struct {
|
|
|
|
Username string `json:"username"`
|
|
|
|
Password string `json:"password"`
|
2019-05-27 18:01:53 +08:00
|
|
|
Remember int `json:"remember"`
|
2019-05-21 11:31:40 +08:00
|
|
|
}
|