working commit
This commit is contained in:
+16
-5
@@ -41,7 +41,7 @@ func (hand *Handler) FileInfo(rctx *router.Context) {
|
||||
}
|
||||
// Execution of the operation
|
||||
ctx := rctx.GetContext()
|
||||
code, res, err := hand.oper.FileInfo(ctx, params)
|
||||
code, res, err := hand.oper.FileInfo(ctx, operatorID, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("FileInfo error: %v", err)
|
||||
rctx.SetStatus(code)
|
||||
@@ -53,6 +53,11 @@ func (hand *Handler) FileInfo(rctx *router.Context) {
|
||||
rctx.SetHeader("Content-Size", res.ContentSize)
|
||||
rctx.SetHeader("Content-Digest", res.ContentDigest)
|
||||
|
||||
rctx.SetHeader("Content-CreatedAt", res.ContentCreatedAt)
|
||||
rctx.SetHeader("Content-CreatedBy", res.ContentCreatedBy)
|
||||
rctx.SetHeader("Content-UpdatedAt", res.ContentUpdatedAt)
|
||||
rctx.SetHeader("Content-UpdatedBy", res.ContentUpdatedBy)
|
||||
|
||||
rctx.SetHeader("Content-Length", zeroContentLength)
|
||||
rctx.SetStatus(code)
|
||||
}
|
||||
@@ -83,7 +88,7 @@ func (hand *Handler) PutFile(rctx *router.Context) {
|
||||
}
|
||||
// Execution of the operation
|
||||
ctx := rctx.GetContext()
|
||||
code, _, err := hand.oper.PutFile(ctx, params)
|
||||
code, _, err := hand.oper.PutFile(ctx, operatorID, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("PutFile error: %v", err)
|
||||
rctx.SetStatus(code)
|
||||
@@ -113,7 +118,7 @@ func (hand *Handler) GetFile(rctx *router.Context) {
|
||||
}
|
||||
// Execution of the operation
|
||||
ctx := rctx.GetContext()
|
||||
code, res, err := hand.oper.GetFile(ctx, params)
|
||||
code, res, err := hand.oper.GetFile(ctx, operatorID, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("PutFile error: %v", err)
|
||||
rctx.SetStatus(code)
|
||||
@@ -124,6 +129,12 @@ func (hand *Handler) GetFile(rctx *router.Context) {
|
||||
rctx.SetHeader("Content-Size", res.ContentSize)
|
||||
rctx.SetHeader("Content-Digest", res.ContentDigest)
|
||||
rctx.SetHeader("Content-Length", res.ContentSize)
|
||||
|
||||
rctx.SetHeader("Content-CreatedAt", res.ContentCreatedAt)
|
||||
rctx.SetHeader("Content-CreatedBy", res.ContentCreatedBy)
|
||||
rctx.SetHeader("Content-UpdatedAt", res.ContentUpdatedAt)
|
||||
rctx.SetHeader("Content-UpdatedBy", res.ContentUpdatedBy)
|
||||
|
||||
rctx.SetStatus(code)
|
||||
|
||||
if res.Source != nil {
|
||||
@@ -157,7 +168,7 @@ func (hand *Handler) DeleteFile(rctx *router.Context) {
|
||||
}
|
||||
// Execution of the operation
|
||||
ctx := rctx.GetContext()
|
||||
code, _, err := hand.oper.DeleteFile(ctx, params)
|
||||
code, _, err := hand.oper.DeleteFile(ctx, operatorID, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("GetFile error: %v", err)
|
||||
}
|
||||
@@ -189,7 +200,7 @@ func (hand *Handler) ListFiles(rctx *router.Context) {
|
||||
}
|
||||
// Execution of the operation
|
||||
ctx := rctx.GetContext()
|
||||
code, res, err := hand.oper.ListFiles(ctx, params)
|
||||
code, res, err := hand.oper.ListFiles(ctx, operatorID, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("ListFiles error: %v", err)
|
||||
rctx.SetStatus(code)
|
||||
|
||||
@@ -41,7 +41,7 @@ func (hand *Handler) CreateGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.CreateGrant(rctx.Ctx, params)
|
||||
res, err := hand.oper.CreateGrant(rctx.Ctx, operatorID, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("CreateGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -74,7 +74,7 @@ func (hand *Handler) GetGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.GetGrant(rctx.Ctx, params)
|
||||
res, err := hand.oper.GetGrant(rctx.Ctx, operatorID, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("CreateGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -107,7 +107,7 @@ func (hand *Handler) ListGrants(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.ListGrants(rctx.Ctx, params)
|
||||
res, err := hand.oper.ListGrants(rctx.Ctx, operatorID, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("ListGrants error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -140,7 +140,7 @@ func (hand *Handler) UpdateGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.UpdateGrant(rctx.Ctx, params)
|
||||
res, err := hand.oper.UpdateGrant(rctx.Ctx, operatorID, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("UpdateGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -173,7 +173,7 @@ func (hand *Handler) DeleteGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.DeleteGrant(rctx.Ctx, params)
|
||||
res, err := hand.oper.DeleteGrant(rctx.Ctx, operatorID, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("DeleteGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
|
||||
Reference in New Issue
Block a user