Files
OpenList/internal/model/object.go

49 lines
611 B
Go
Raw Normal View History

2022-06-15 18:06:42 +08:00
package model
2022-06-06 21:48:53 +08:00
2022-06-15 20:41:17 +08:00
import "time"
2022-06-06 21:48:53 +08:00
2022-06-15 20:41:17 +08:00
type Object struct {
ID string
Name string
2022-06-23 15:57:36 +08:00
Size int64
2022-06-15 20:41:17 +08:00
Modified time.Time
IsFolder bool
2022-06-06 21:48:53 +08:00
}
2022-08-11 20:32:17 +08:00
func (o Object) GetName() string {
return o.Name
2022-06-06 21:48:53 +08:00
}
2022-06-07 22:02:41 +08:00
2022-08-11 20:32:17 +08:00
func (o Object) GetSize() int64 {
return o.Size
2022-06-07 22:02:41 +08:00
}
2022-08-11 20:32:17 +08:00
func (o Object) ModTime() time.Time {
return o.Modified
2022-06-15 20:41:17 +08:00
}
2022-08-11 20:32:17 +08:00
func (o Object) IsDir() bool {
return o.IsFolder
2022-06-15 20:41:17 +08:00
}
2022-08-11 20:32:17 +08:00
func (o Object) GetID() string {
return o.ID
2022-06-07 22:02:41 +08:00
}
2022-06-16 20:25:33 +08:00
2022-08-11 20:32:17 +08:00
func (o *Object) SetID(id string) {
o.ID = id
}
type Thumbnail struct {
Thumbnail string
}
func (t Thumbnail) Thumb() string {
return t.Thumbnail
}
type ObjectThumbnail struct {
Object
Thumbnail
2022-06-16 20:25:33 +08:00
}