2021-12-14 20:08:12 +08:00
|
|
|
package api
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type Resource struct {
|
2022-02-04 16:51:48 +08:00
|
|
|
Id int `json:"id"`
|
|
|
|
CreatedTs int64 `json:"createdTs"`
|
|
|
|
UpdatedTs int64 `json:"updatedTs"`
|
2021-12-14 20:08:12 +08:00
|
|
|
|
2022-02-04 16:51:48 +08:00
|
|
|
Filename string `json:"filename"`
|
|
|
|
Blob []byte `json:"blob"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Size int64 `json:"size"`
|
2021-12-14 20:08:12 +08:00
|
|
|
|
2022-02-04 16:51:48 +08:00
|
|
|
CreatorId int `json:"creatorId"`
|
2021-12-14 20:08:12 +08:00
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type ResourceCreate struct {
|
2022-02-04 16:51:48 +08:00
|
|
|
Filename string `json:"filename"`
|
|
|
|
Blob []byte `json:"blob"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Size int64 `json:"size"`
|
2021-12-14 20:08:12 +08:00
|
|
|
|
2022-02-04 16:51:48 +08:00
|
|
|
CreatorId int
|
2021-12-14 20:08:12 +08:00
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type ResourceFind struct {
|
2022-02-04 16:51:48 +08:00
|
|
|
Id *int `json:"id"`
|
|
|
|
CreatorId *int `json:"creatorId"`
|
|
|
|
Filename *string `json:"filename"`
|
2021-12-14 20:08:12 +08:00
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type ResourceDelete struct {
|
|
|
|
Id int
|
2021-12-14 20:08:12 +08:00
|
|
|
}
|
|
|
|
|
2022-02-03 15:32:03 +08:00
|
|
|
type ResourceService interface {
|
|
|
|
CreateResource(create *ResourceCreate) (*Resource, error)
|
|
|
|
FindResourceList(find *ResourceFind) ([]*Resource, error)
|
|
|
|
FindResource(find *ResourceFind) (*Resource, error)
|
|
|
|
DeleteResource(delete *ResourceDelete) error
|
2021-12-14 20:08:12 +08:00
|
|
|
}
|