mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: {path} marker in name rule representing the virtual path of the file
This commit is contained in:
@@ -33,11 +33,16 @@ func (file FileData) GetFileName() string {
|
||||
return file.Name
|
||||
}
|
||||
|
||||
func (file FileData) GetVirtualPath() string {
|
||||
return file.Name
|
||||
}
|
||||
|
||||
type FileStream struct {
|
||||
File io.ReadCloser
|
||||
Size uint64
|
||||
Name string
|
||||
MIMEType string
|
||||
File io.ReadCloser
|
||||
Size uint64
|
||||
VirtualPath string
|
||||
Name string
|
||||
MIMEType string
|
||||
}
|
||||
|
||||
func (file FileStream) Read(p []byte) (n int, err error) {
|
||||
@@ -59,3 +64,7 @@ func (file FileStream) Close() error {
|
||||
func (file FileStream) GetFileName() string {
|
||||
return file.Name
|
||||
}
|
||||
|
||||
func (file FileStream) GetVirtualPath() string {
|
||||
return file.VirtualPath
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
}
|
||||
// Handler 本地策略适配器
|
||||
type Handler struct{}
|
||||
|
||||
// Put 将文件流保存到指定目录
|
||||
func (handler Handler) Put(ctx context.Context, file io.ReadCloser, dst string) error {
|
||||
|
||||
Reference in New Issue
Block a user