memos/api/memo.go
2022-03-29 00:01:34 +08:00

44 lines
904 B
Go

package api
type Memo struct {
Id int `json:"id"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
RowStatus string `json:"rowStatus"`
Content string `json:"content"`
CreatorId int `json:"creatorId"`
}
type MemoCreate struct {
CreatorId int
Content string `json:"content"`
}
type MemoPatch struct {
Id int
Content *string `json:"content"`
RowStatus *string `json:"rowStatus"`
CreatedTs *int64 `json:"createdTs"`
}
type MemoFind struct {
Id *int `json:"id"`
CreatorId *int `json:"creatorId"`
RowStatus *string `json:"rowStatus"`
}
type MemoDelete struct {
Id *int `json:"id"`
}
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
}