2021-12-08 23:43:14 +08:00
|
|
|
package api
|
|
|
|
|
2022-07-08 22:23:27 +08:00
|
|
|
// Visibility is the type of a visibility.
|
|
|
|
type Visibility string
|
|
|
|
|
|
|
|
const (
|
|
|
|
// Public is the PUBLIC visibility.
|
|
|
|
Public Visibility = "PUBLIC"
|
2022-07-26 21:12:20 +08:00
|
|
|
// Protected is the PROTECTED visibility.
|
|
|
|
Protected Visibility = "PROTECTED"
|
2022-11-26 14:23:29 +08:00
|
|
|
// Private is the PRIVATE visibility.
|
|
|
|
Private Visibility = "PRIVATE"
|
2022-07-08 22:23:27 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func (e Visibility) String() string {
|
|
|
|
switch e {
|
|
|
|
case Public:
|
|
|
|
return "PUBLIC"
|
2022-07-26 21:12:20 +08:00
|
|
|
case Protected:
|
|
|
|
return "PROTECTED"
|
2022-11-26 14:23:29 +08:00
|
|
|
case Private:
|
2022-07-08 22:23:27 +08:00
|
|
|
return "PRIVATE"
|
|
|
|
}
|
|
|
|
return "PRIVATE"
|
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type Memo struct {
|
2022-05-03 11:49:10 +08:00
|
|
|
ID int `json:"id"`
|
|
|
|
|
|
|
|
// Standard fields
|
2022-05-19 18:32:04 +08:00
|
|
|
RowStatus RowStatus `json:"rowStatus"`
|
|
|
|
CreatorID int `json:"creatorId"`
|
|
|
|
CreatedTs int64 `json:"createdTs"`
|
|
|
|
UpdatedTs int64 `json:"updatedTs"`
|
2022-02-03 15:32:03 +08:00
|
|
|
|
2022-05-03 11:49:10 +08:00
|
|
|
// Domain specific fields
|
2022-07-08 22:23:27 +08:00
|
|
|
Content string `json:"content"`
|
|
|
|
Visibility Visibility `json:"visibility"`
|
|
|
|
Pinned bool `json:"pinned"`
|
2022-10-21 19:57:57 +08:00
|
|
|
DisplayTs int64 `json:"displayTs"`
|
2022-09-05 21:14:17 +08:00
|
|
|
|
|
|
|
// Related fields
|
2022-10-01 09:49:59 +08:00
|
|
|
Creator *User `json:"creator"`
|
|
|
|
ResourceList []*Resource `json:"resourceList"`
|
2021-12-08 23:43:14 +08:00
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type MemoCreate struct {
|
2022-05-03 11:49:10 +08:00
|
|
|
// Standard fields
|
2023-02-11 21:32:42 +08:00
|
|
|
CreatorID int `json:"-"`
|
|
|
|
CreatedTs *int64 `json:"createdTs"`
|
2022-02-18 22:21:10 +08:00
|
|
|
|
2022-05-03 11:49:10 +08:00
|
|
|
// Domain specific fields
|
2022-08-25 22:02:32 +08:00
|
|
|
Visibility Visibility `json:"visibility"`
|
|
|
|
Content string `json:"content"`
|
2022-10-01 10:57:14 +08:00
|
|
|
|
|
|
|
// Related fields
|
|
|
|
ResourceIDList []int `json:"resourceIdList"`
|
2021-12-08 23:43:14 +08:00
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type MemoPatch struct {
|
2022-12-23 18:38:24 +08:00
|
|
|
ID int `json:"-"`
|
2021-12-08 23:43:14 +08:00
|
|
|
|
2022-05-03 11:49:10 +08:00
|
|
|
// Standard fields
|
2022-10-21 19:57:57 +08:00
|
|
|
CreatedTs *int64 `json:"createdTs"`
|
|
|
|
UpdatedTs *int64
|
2022-05-19 18:32:04 +08:00
|
|
|
RowStatus *RowStatus `json:"rowStatus"`
|
2022-05-03 11:49:10 +08:00
|
|
|
|
|
|
|
// Domain specific fields
|
2022-07-08 22:23:27 +08:00
|
|
|
Content *string `json:"content"`
|
|
|
|
Visibility *Visibility `json:"visibility"`
|
2022-10-21 22:16:05 +08:00
|
|
|
|
|
|
|
// Related fields
|
|
|
|
ResourceIDList []int `json:"resourceIdList"`
|
2021-12-09 22:02:57 +08:00
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type MemoFind struct {
|
2022-12-28 20:22:52 +08:00
|
|
|
ID *int
|
2022-05-03 11:49:10 +08:00
|
|
|
|
|
|
|
// Standard fields
|
2022-12-28 20:22:52 +08:00
|
|
|
RowStatus *RowStatus
|
|
|
|
CreatorID *int
|
2022-05-19 18:32:04 +08:00
|
|
|
|
|
|
|
// Domain specific fields
|
2022-07-26 21:12:20 +08:00
|
|
|
Pinned *bool
|
|
|
|
ContentSearch *string
|
|
|
|
VisibilityList []Visibility
|
2022-06-21 21:58:33 +08:00
|
|
|
|
|
|
|
// Pagination
|
|
|
|
Limit int
|
|
|
|
Offset int
|
2021-12-08 23:43:14 +08:00
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type MemoDelete struct {
|
2022-11-06 12:21:58 +08:00
|
|
|
ID int
|
2022-02-03 15:32:03 +08:00
|
|
|
}
|