memos/api/memo.go

42 lines
853 B
Go
Raw Normal View History

2021-12-08 18:43:14 +03:00
package api
2022-02-03 10:32:03 +03:00
type Memo struct {
Id int `jsonapi:"primary,memo"`
CreatedTs int64 `jsonapi:"attr,createdTs"`
UpdatedTs int64 `jsonapi:"attr,updatedTs"`
RowStatus string `jsonapi:"attr,rowStatus"`
Content string `jsonapi:"attr,content"`
CreatorId int `jsonapi:"attr,creatorId"`
2021-12-08 18:43:14 +03:00
}
2022-02-03 10:32:03 +03:00
type MemoCreate struct {
Content string `jsonapi:"attr,content"`
CreatorId int
2021-12-08 18:43:14 +03:00
}
2022-02-03 10:32:03 +03:00
type MemoPatch struct {
Id int
2021-12-08 18:43:14 +03:00
2022-02-03 10:32:03 +03:00
Content *string
RowStatus *string
2021-12-09 17:02:57 +03:00
}
2022-02-03 10:32:03 +03:00
type MemoFind struct {
Id *int
CreatorId *int
2021-12-08 18:43:14 +03:00
}
2022-02-03 10:32:03 +03:00
type MemoDelete struct {
Id *int `jsonapi:"primary,memo"`
CreatorId *int
}
2021-12-10 08:41:17 +03:00
2022-02-03 10:32:03 +03: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 18:43:14 +03:00
}