memos/api/shortcut.go

52 lines
1 KiB
Go
Raw Normal View History

2022-02-03 15:32:03 +08:00
package api
type Shortcut struct {
Id int `json:"id"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
2022-02-03 15:32:03 +08:00
Title string `json:"title"`
Payload string `json:"payload"`
RowStatus string `json:"rowStatus"`
2022-02-03 15:32:03 +08:00
CreatorId int
}
type ShortcutCreate struct {
// Standard fields
CreatorId int
// Domain specific fields
Title string `json:"title"`
Payload string `json:"payload"`
2022-02-03 15:32:03 +08:00
}
type ShortcutPatch struct {
Id int
Title *string `json:"title"`
Payload *string `json:"payload"`
RowStatus *string `json:"rowStatus"`
2022-02-03 15:32:03 +08:00
}
type ShortcutFind struct {
Id *int
// Standard fields
CreatorId *int
// Domain specific fields
Title *string `json:"title"`
2022-02-03 15:32:03 +08:00
}
type ShortcutDelete struct {
Id int
}
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
}