memos/api/resource.go

56 lines
1021 B
Go
Raw Normal View History

package api
2022-02-03 10:32:03 +03:00
type Resource struct {
2022-05-03 06:49:10 +03:00
ID int `json:"id"`
// Standard fields
CreatorID int `json:"creatorId"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
2022-05-03 06:49:10 +03:00
// Domain specific fields
Filename string `json:"filename"`
Blob []byte `json:"-"`
Type string `json:"type"`
Size int64 `json:"size"`
// Related fields
LinkedMemoAmount int `json:"linkedMemoAmount"`
}
2022-02-03 10:32:03 +03:00
type ResourceCreate struct {
2022-05-03 06:49:10 +03:00
// Standard fields
2022-12-28 15:22:52 +03:00
CreatorID int `json:"-"`
2022-05-03 06:49:10 +03:00
// Domain specific fields
Filename string `json:"filename"`
Blob []byte `json:"blob"`
Type string `json:"type"`
Size int64 `json:"size"`
}
2022-02-03 10:32:03 +03:00
type ResourceFind struct {
2022-05-03 06:49:10 +03:00
ID *int `json:"id"`
// Standard fields
CreatorID *int `json:"creatorId"`
// Domain specific fields
Filename *string `json:"filename"`
MemoID *int
}
type ResourcePatch struct {
2022-12-23 13:38:24 +03:00
ID int `json:"-"`
// Standard fields
UpdatedTs *int64
2022-11-06 07:21:58 +03:00
// Domain specific fields
Filename *string `json:"filename"`
}
2022-11-06 07:21:58 +03:00
type ResourceDelete struct {
ID int
}