From 9b89b5c7826a5f3f4dae91011fc30b3583a83b09 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Wed, 29 Mar 2023 11:04:34 +0800 Subject: [PATCH] third --- pkg/common/db/controller/storage.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pkg/common/db/controller/storage.go b/pkg/common/db/controller/storage.go index abcadfd24..ce43a2db2 100644 --- a/pkg/common/db/controller/storage.go +++ b/pkg/common/db/controller/storage.go @@ -122,10 +122,11 @@ func (c *s3Database) ApplyPut(ctx context.Context, req *third.ApplyPutReq) (*thi } if hash, err := c.hash.Take(ctx, req.Hash, c.obj.Name()); err == nil { o := relation.ObjectInfoModel{ - Name: req.Name, - Hash: hash.Hash, - ValidTime: expirationTime, - CreateTime: time.Now(), + Name: req.Name, + Hash: hash.Hash, + ValidTime: expirationTime, + ContentType: req.ContentType, + CreateTime: time.Now(), } if err := c.info.SetObject(ctx, &o); err != nil { return nil, err @@ -240,10 +241,11 @@ func (c *s3Database) ConfirmPut(ctx context.Context, req *third.ConfirmPutReq) ( } if hash, err := c.hash.Take(ctx, put.Hash, c.obj.Name()); err == nil { o := relation.ObjectInfoModel{ - Name: put.Name, - Hash: hash.Hash, - ValidTime: put.ValidTime, - CreateTime: time.Now(), + Name: put.Name, + Hash: hash.Hash, + ValidTime: put.ValidTime, + ContentType: put.ContentType, + CreateTime: time.Now(), } if err := c.info.SetObject(ctx, &o); err != nil { return nil, err