working commit
This commit is contained in:
+13
-6
@@ -16,8 +16,8 @@ func (hand *Handler) FileExists(rctx *router.Context) {
|
||||
params := &operator.FileExistsParams{
|
||||
Filepath: filepath,
|
||||
}
|
||||
|
||||
code, res, err := hand.oper.FileExists(params)
|
||||
ctx := rctx.GetContext()
|
||||
code, res, err := hand.oper.FileExists(ctx, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("FileExists error: %v", err)
|
||||
rctx.SetStatus(code)
|
||||
@@ -46,7 +46,9 @@ func (hand *Handler) PutFile(rctx *router.Context) {
|
||||
ContentType: contentType,
|
||||
Source: rctx.Request.Body,
|
||||
}
|
||||
code, _, err := hand.oper.PutFile(params)
|
||||
ctx := rctx.GetContext()
|
||||
|
||||
code, _, err := hand.oper.PutFile(ctx, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("PutFile error: %v", err)
|
||||
rctx.SetStatus(code)
|
||||
@@ -64,7 +66,8 @@ func (hand *Handler) GetFile(rctx *router.Context) {
|
||||
}
|
||||
hand.logg.Debugf("filepath: %s", filepath)
|
||||
|
||||
code, res, err := hand.oper.GetFile(params)
|
||||
ctx := rctx.GetContext()
|
||||
code, res, err := hand.oper.GetFile(ctx, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("PutFile error: %v", err)
|
||||
rctx.SetStatus(code)
|
||||
@@ -93,10 +96,12 @@ func (hand *Handler) DeleteFile(rctx *router.Context) {
|
||||
params := &operator.DeleteFileParams{
|
||||
Filepath: filepath,
|
||||
}
|
||||
code, _, err := hand.oper.DeleteFile(params)
|
||||
ctx := rctx.GetContext()
|
||||
code, _, err := hand.oper.DeleteFile(ctx, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("GetFile error: %v", err)
|
||||
}
|
||||
|
||||
rctx.SetStatus(code)
|
||||
}
|
||||
|
||||
@@ -107,7 +112,9 @@ func (hand *Handler) ListFiles(rctx *router.Context) {
|
||||
params := &operator.ListFilesParams{
|
||||
Filepath: filepath,
|
||||
}
|
||||
code, res, err := hand.oper.ListFiles(params)
|
||||
ctx := rctx.GetContext()
|
||||
|
||||
code, res, err := hand.oper.ListFiles(ctx, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("ListFiles error: %v", err)
|
||||
rctx.SetStatus(code)
|
||||
|
||||
Reference in New Issue
Block a user