2021-12-14 20:08:12 +08:00
|
|
|
package api
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type Resource struct {
|
2022-05-03 11:49:10 +08:00
|
|
|
ID int `json:"id"`
|
|
|
|
|
|
|
|
// Standard fields
|
|
|
|
CreatorID int `json:"creatorId"`
|
2022-02-04 16:51:48 +08:00
|
|
|
CreatedTs int64 `json:"createdTs"`
|
|
|
|
UpdatedTs int64 `json:"updatedTs"`
|
2021-12-14 20:08:12 +08:00
|
|
|
|
2022-05-03 11:49:10 +08:00
|
|
|
// Domain specific fields
|
2023-04-02 14:09:25 +08:00
|
|
|
Filename string `json:"filename"`
|
|
|
|
Blob []byte `json:"-"`
|
|
|
|
InternalPath string `json:"internalPath"`
|
|
|
|
ExternalLink string `json:"externalLink"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Size int64 `json:"size"`
|
2023-04-03 13:41:27 +08:00
|
|
|
PublicID string `json:"publicId"`
|
2022-10-03 09:39:49 +08:00
|
|
|
|
|
|
|
// Related fields
|
|
|
|
LinkedMemoAmount int `json:"linkedMemoAmount"`
|
2021-12-14 20:08:12 +08:00
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type ResourceCreate struct {
|
2022-05-03 11:49:10 +08:00
|
|
|
// Standard fields
|
2022-12-28 20:22:52 +08:00
|
|
|
CreatorID int `json:"-"`
|
2022-05-03 11:49:10 +08:00
|
|
|
|
|
|
|
// Domain specific fields
|
2023-04-02 14:09:25 +08:00
|
|
|
Filename string `json:"filename"`
|
|
|
|
Blob []byte `json:"-"`
|
|
|
|
InternalPath string `json:"internalPath"`
|
|
|
|
ExternalLink string `json:"externalLink"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Size int64 `json:"-"`
|
2023-04-03 13:41:27 +08:00
|
|
|
PublicID string `json:"publicId"`
|
2021-12-14 20:08:12 +08:00
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type ResourceFind struct {
|
2022-05-03 11:49:10 +08:00
|
|
|
ID *int `json:"id"`
|
|
|
|
|
|
|
|
// Standard fields
|
|
|
|
CreatorID *int `json:"creatorId"`
|
|
|
|
|
|
|
|
// Domain specific fields
|
2022-12-16 22:20:17 +08:00
|
|
|
Filename *string `json:"filename"`
|
|
|
|
MemoID *int
|
2023-04-03 13:41:27 +08:00
|
|
|
PublicID *string `json:"publicId"`
|
2023-01-25 16:11:02 +08:00
|
|
|
GetBlob bool
|
2023-04-01 16:51:20 +08:00
|
|
|
|
|
|
|
// Pagination
|
|
|
|
Limit *int
|
|
|
|
Offset *int
|
2021-12-14 20:08:12 +08:00
|
|
|
}
|
|
|
|
|
2022-10-29 15:40:09 +08:00
|
|
|
type ResourcePatch struct {
|
2022-12-23 18:38:24 +08:00
|
|
|
ID int `json:"-"`
|
2022-10-29 15:40:09 +08:00
|
|
|
|
|
|
|
// Standard fields
|
|
|
|
UpdatedTs *int64
|
|
|
|
|
2022-11-06 12:21:58 +08:00
|
|
|
// Domain specific fields
|
2023-04-03 13:41:27 +08:00
|
|
|
Filename *string `json:"filename"`
|
|
|
|
ResetPublicID *bool `json:"resetPublicId"`
|
|
|
|
PublicID *string `json:"-"`
|
2022-10-29 15:40:09 +08:00
|
|
|
}
|
2022-11-06 12:21:58 +08:00
|
|
|
|
|
|
|
type ResourceDelete struct {
|
|
|
|
ID int
|
|
|
|
}
|