working commit

This commit is contained in:
2026-02-03 11:54:34 +02:00
parent 5cd8797e33
commit fe0a3afcdd
10 changed files with 56 additions and 171 deletions
+13 -6
View File
@@ -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)