Feat: onedrive client upload / callback

This commit is contained in:
HFO4
2020-01-20 14:34:21 +08:00
parent 807aa5ac18
commit dd5f6e3d25
10 changed files with 359 additions and 35 deletions

View File

@ -148,8 +148,10 @@ func (fs *FileSystem) GetUploadToken(ctx context.Context, path string, size uint
var err error
// 是否需要预先生成存储路径
var savePath string
if fs.User.Policy.IsPathGenerateNeeded() {
ctx = context.WithValue(ctx, fsctx.SavePathCtx, fs.GenerateSavePath(ctx, local.FileStream{}))
savePath = fs.GenerateSavePath(ctx, local.FileStream{Name: name})
ctx = context.WithValue(ctx, fsctx.SavePathCtx, savePath)
}
ctx = context.WithValue(ctx, fsctx.FileSizeCtx, size)
@ -168,6 +170,8 @@ func (fs *FileSystem) GetUploadToken(ctx context.Context, path string, size uint
PolicyID: fs.User.GetPolicyID(),
VirtualPath: path,
Name: name,
Size: size,
SavePath: savePath,
},
callBackSessionTTL,
)