mirror of
https://github.com/usememos/memos.git
synced 2025-02-19 12:50:41 +01:00
41 lines
985 B
Go
41 lines
985 B
Go
package api
|
|
|
|
type Resource struct {
|
|
Id int `jsonapi:"primary,resource"`
|
|
CreatedTs int64 `jsonapi:"attr,createdTs"`
|
|
UpdatedTs int64 `jsonapi:"attr,updatedTs"`
|
|
|
|
Filename string `jsonapi:"attr,filename"`
|
|
Blob []byte `jsonapi:"attr,blob"`
|
|
Type string `jsonapi:"attr,type"`
|
|
Size int64 `jsonapi:"attr,size"`
|
|
|
|
CreatorId int `jsonapi:"attr,creatorId"`
|
|
}
|
|
|
|
type ResourceCreate struct {
|
|
Filename string `jsonapi:"attr,filename"`
|
|
Blob []byte `jsonapi:"attr,blob"`
|
|
Type string `jsonapi:"attr,type"`
|
|
Size int64 `jsonapi:"attr,size"`
|
|
|
|
CreatorId int `jsonapi:"attr,creatorId"`
|
|
}
|
|
|
|
type ResourceFind struct {
|
|
Id *int
|
|
CreatorId *int
|
|
Filename *string
|
|
}
|
|
|
|
type ResourceDelete struct {
|
|
Id int
|
|
}
|
|
|
|
type ResourceService interface {
|
|
CreateResource(create *ResourceCreate) (*Resource, error)
|
|
FindResourceList(find *ResourceFind) ([]*Resource, error)
|
|
FindResource(find *ResourceFind) (*Resource, error)
|
|
DeleteResource(delete *ResourceDelete) error
|
|
}
|