Feat: sign file source url

This commit is contained in:
HFO4
2019-12-10 17:10:34 +08:00
parent 1963a495fb
commit 36d5f51495
15 changed files with 174 additions and 47 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/local"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/jinzhu/gorm"
@@ -35,8 +36,8 @@ func TestFileSystem_AddFile(t *testing.T) {
},
},
}
ctx := context.WithValue(context.Background(), FileHeaderCtx, file)
ctx = context.WithValue(ctx, SavePathCtx, "/Uploads/1_sad.txt")
ctx := context.WithValue(context.Background(), fsctx.FileHeaderCtx, file)
ctx = context.WithValue(ctx, fsctx.SavePathCtx, "/Uploads/1_sad.txt")
_, err := fs.AddFile(ctx, &folder)