Feat: {path} marker in name rule representing the virtual path of the file

This commit is contained in:
HFO4
2019-11-19 16:42:36 +08:00
parent 2e9f256462
commit 88a543ef74
8 changed files with 71 additions and 33 deletions

View File

@@ -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
}

View File

@@ -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 {