mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-24 06:14:04 +08:00

* refactor:Prepare to remove the get interface * feat:add obj Unwarp interface * refactor:obj name mapping and program internal path processing * chore: fix typo * feat: unwrap get * fix: no use op.Get to get parent id * fix: set the path uniformly Co-authored-by: Noah Hsu <i@nn.ci>
34 lines
477 B
Go
34 lines
477 B
Go
package model
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
type FileStream struct {
|
|
Obj
|
|
io.ReadCloser
|
|
Mimetype string
|
|
WebPutAsTask bool
|
|
Old Obj
|
|
}
|
|
|
|
func (f *FileStream) GetMimetype() string {
|
|
return f.Mimetype
|
|
}
|
|
|
|
func (f *FileStream) NeedStore() bool {
|
|
return f.WebPutAsTask
|
|
}
|
|
|
|
func (f *FileStream) GetReadCloser() io.ReadCloser {
|
|
return f.ReadCloser
|
|
}
|
|
|
|
func (f *FileStream) SetReadCloser(rc io.ReadCloser) {
|
|
f.ReadCloser = rc
|
|
}
|
|
|
|
func (f *FileStream) GetOld() Obj {
|
|
return f.Old
|
|
}
|