feat: local storage image thumbnail

This commit is contained in:
Noah Hsu
2022-08-11 20:32:17 +08:00
parent fda4db71bf
commit af884010d1
19 changed files with 178 additions and 61 deletions

View File

@ -6,9 +6,14 @@ import (
"time"
)
type ListArgs struct {
ReqPath string
}
type LinkArgs struct {
IP string
Header http.Header
Type string
}
type Link struct {

View File

@ -28,8 +28,8 @@ type URL interface {
URL() string
}
type Thumbnail interface {
Thumbnail() string
type Thumb interface {
Thumb() string
}
type SetID interface {

View File

@ -10,26 +10,39 @@ type Object struct {
IsFolder bool
}
func (f Object) GetName() string {
return f.Name
func (o Object) GetName() string {
return o.Name
}
func (f Object) GetSize() int64 {
return f.Size
func (o Object) GetSize() int64 {
return o.Size
}
func (f Object) ModTime() time.Time {
return f.Modified
func (o Object) ModTime() time.Time {
return o.Modified
}
func (f Object) IsDir() bool {
return f.IsFolder
func (o Object) IsDir() bool {
return o.IsFolder
}
func (f Object) GetID() string {
return f.ID
func (o Object) GetID() string {
return o.ID
}
func (f *Object) SetID(id string) {
f.ID = id
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
}