memos/api/shortcut.go

58 lines
1.1 KiB
Go
Raw Normal View History

2022-02-03 15:32:03 +08:00
package api
type Shortcut struct {
2022-05-03 11:49:10 +08:00
ID int `json:"id"`
2022-02-03 15:32:03 +08:00
2022-05-03 11:49:10 +08:00
// Standard fields
2022-05-03 02:05:43 +08:00
CreatorID int
2022-05-03 11:49:10 +08:00
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
RowStatus string `json:"rowStatus"`
// Domain specific fields
Title string `json:"title"`
Payload string `json:"payload"`
2022-02-03 15:32:03 +08:00
}
type ShortcutCreate struct {
// Standard fields
2022-05-03 02:05:43 +08:00
CreatorID int
2022-02-03 15:32:03 +08:00
// Domain specific fields
Title string `json:"title"`
Payload string `json:"payload"`
2022-02-03 15:32:03 +08:00
}
type ShortcutPatch struct {
2022-05-03 02:05:43 +08:00
ID int
2022-02-03 15:32:03 +08:00
2022-05-03 11:49:10 +08:00
// Standard fields
RowStatus *string `json:"rowStatus"`
2022-05-03 11:49:10 +08:00
// Domain specific fields
Title *string `json:"title"`
Payload *string `json:"payload"`
2022-02-03 15:32:03 +08:00
}
type ShortcutFind struct {
2022-05-03 02:05:43 +08:00
ID *int
2022-02-03 15:32:03 +08:00
// Standard fields
2022-05-03 02:05:43 +08:00
CreatorID *int
2022-02-03 15:32:03 +08:00
// Domain specific fields
Title *string `json:"title"`
2022-02-03 15:32:03 +08:00
}
type ShortcutDelete struct {
2022-05-03 02:05:43 +08:00
ID int
2022-02-03 15:32:03 +08:00
}
type ShortcutService interface {
CreateShortcut(create *ShortcutCreate) (*Shortcut, error)
PatchShortcut(patch *ShortcutPatch) (*Shortcut, error)
FindShortcutList(find *ShortcutFind) ([]*Shortcut, error)
FindShortcut(find *ShortcutFind) (*Shortcut, error)
DeleteShortcut(delete *ShortcutDelete) error
}