Files
OpenList/internal/model/object.go

68 lines
780 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-09-02 18:24:14 +08:00
func (o *Object) GetName() string {
2022-08-11 20:32:17 +08:00
return o.Name
2022-06-06 21:48:53 +08:00
}
2022-06-07 22:02:41 +08:00
2022-09-02 18:24:14 +08:00
func (o *Object) GetSize() int64 {
2022-08-11 20:32:17 +08:00
return o.Size
2022-06-07 22:02:41 +08:00
}
2022-09-02 18:24:14 +08:00
func (o *Object) ModTime() time.Time {
2022-08-11 20:32:17 +08:00
return o.Modified
2022-06-15 20:41:17 +08:00
}
2022-09-02 18:24:14 +08:00
func (o *Object) IsDir() bool {
2022-08-11 20:32:17 +08:00
return o.IsFolder
2022-06-15 20:41:17 +08:00
}
2022-09-02 18:24:14 +08:00
func (o *Object) GetID() string {
2022-08-11 20:32:17 +08:00
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
}
2022-09-02 18:24:14 +08:00
type Url struct {
Url string
}
func (w Url) URL() string {
return w.Url
}
2022-08-11 20:32:17 +08:00
func (t Thumbnail) Thumb() string {
return t.Thumbnail
}
2022-09-02 18:24:14 +08:00
type ObjThumb struct {
Object
Thumbnail
}
type ObjectURL struct {
Object
Url
}
type ObjThumbURL struct {
2022-08-11 20:32:17 +08:00
Object
Thumbnail
2022-09-02 18:24:14 +08:00
Url
2022-06-16 20:25:33 +08:00
}