memos/api/memo.go

44 lines
904 B
Go
Raw Normal View History

2021-12-08 23:43:14 +08:00
package api
2022-02-03 15:32:03 +08:00
type Memo struct {
2022-05-03 02:05:43 +08:00
ID int `json:"id"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
RowStatus string `json:"rowStatus"`
2022-02-03 15:32:03 +08:00
Content string `json:"content"`
2022-05-03 02:05:43 +08:00
CreatorID int `json:"creatorId"`
2021-12-08 23:43:14 +08:00
}
2022-02-03 15:32:03 +08:00
type MemoCreate struct {
2022-05-03 02:05:43 +08:00
CreatorID int
2022-02-18 22:21:10 +08:00
Content string `json:"content"`
2021-12-08 23:43:14 +08:00
}
2022-02-03 15:32:03 +08:00
type MemoPatch struct {
2022-05-03 02:05:43 +08:00
ID int
2021-12-08 23:43:14 +08:00
2022-02-05 11:43:25 +08:00
Content *string `json:"content"`
RowStatus *string `json:"rowStatus"`
2022-03-29 00:01:34 +08:00
CreatedTs *int64 `json:"createdTs"`
2021-12-09 22:02:57 +08:00
}
2022-02-03 15:32:03 +08:00
type MemoFind struct {
2022-05-03 02:05:43 +08:00
ID *int `json:"id"`
CreatorID *int `json:"creatorId"`
2022-02-05 11:43:25 +08:00
RowStatus *string `json:"rowStatus"`
2021-12-08 23:43:14 +08:00
}
2022-02-03 15:32:03 +08:00
type MemoDelete struct {
2022-05-03 02:05:43 +08:00
ID *int `json:"id"`
2022-02-03 15:32:03 +08:00
}
2021-12-10 13:41:17 +08:00
2022-02-03 15:32:03 +08:00
type MemoService interface {
CreateMemo(create *MemoCreate) (*Memo, error)
PatchMemo(patch *MemoPatch) (*Memo, error)
FindMemoList(find *MemoFind) ([]*Memo, error)
FindMemo(find *MemoFind) (*Memo, error)
DeleteMemo(delete *MemoDelete) error
2021-12-08 23:43:14 +08:00
}