diff --git a/biz/application/service/file.go b/biz/application/service/file.go index ce04bef..4840d67 100644 --- a/biz/application/service/file.go +++ b/biz/application/service/file.go @@ -82,6 +82,7 @@ func (s *FileService) GetFile(ctx context.Context, req *gencontent.GetFileReq) ( } resp.File.SpaceSize = res.SpaceSize } + return resp, nil } diff --git a/biz/infrastructure/convertor/convertor.go b/biz/infrastructure/convertor/convertor.go index ce9d12d..2b64474 100644 --- a/biz/infrastructure/convertor/convertor.go +++ b/biz/infrastructure/convertor/convertor.go @@ -48,15 +48,17 @@ func UserToUserMapper(in *gencontent.User) *usermapper.User { func FileMapperToFile(data *file.File) *gencontent.FileInfo { return &gencontent.FileInfo{ - FileId: data.ID.Hex(), - Name: data.Name, - Type: gencontent.Type(data.Type), - Path: data.Path, - UserId: data.UserId, - FatherId: data.FatherId, - SpaceSize: *data.Size, - Md5: data.FileMd5, - UpdateAt: data.UpdateAt.Unix(), + FileId: data.ID.Hex(), + UserId: data.UserId, + Name: data.Name, + Type: gencontent.Type(data.Type), + Path: data.Path, + FatherId: data.FatherId, + SpaceSize: *data.Size, + Md5: data.FileMd5, + UpdateAt: data.UpdateAt.Unix(), + Tag: data.Tags, + Description: data.Description, } } diff --git a/biz/infrastructure/mapper/file/mongo.go b/biz/infrastructure/mapper/file/mongo.go index 1303316..434eb55 100644 --- a/biz/infrastructure/mapper/file/mongo.go +++ b/biz/infrastructure/mapper/file/mongo.go @@ -234,7 +234,7 @@ func (m *MongoMapper) FindFolderSize(ctx context.Context, path string) (int64, e }, } - result, err := m.conn.Database().Collection("cloudmind_contentcenter").Aggregate(ctx, pipeline) + result, err := m.conn.Database().Collection(CollectionName).Aggregate(ctx, pipeline) switch { case err == nil: if result.Next(ctx) {