LoadAll evolve
This commit is contained in:
parent
aa7ce56174
commit
b775298bb0
@ -2,7 +2,6 @@ package data
|
||||
|
||||
import (
|
||||
mongo "cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
)
|
||||
|
||||
@ -46,9 +45,9 @@ func (wfa DataMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int, error) {
|
||||
return nil, code, err
|
||||
}
|
||||
for res_mongo.Next(mongo.MngoCtx) {
|
||||
var obj resources.AbstractResource
|
||||
var obj DataResource
|
||||
res_mongo.Decode(&obj)
|
||||
objs = append(objs, &obj)
|
||||
objs = append(objs, &obj.AbstractResource)
|
||||
}
|
||||
return objs, 200, nil
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package datacenter
|
||||
|
||||
import (
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
)
|
||||
|
||||
@ -48,9 +47,9 @@ func (wfa DatacenterMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int, erro
|
||||
return nil, code, err
|
||||
}
|
||||
for res_mongo.Next(mongo.MngoCtx) {
|
||||
var obj resources.AbstractResource
|
||||
var obj DatacenterResource
|
||||
res_mongo.Decode(&obj)
|
||||
objs = append(objs, &obj)
|
||||
objs = append(objs, &obj.AbstractResource)
|
||||
}
|
||||
return objs, 200, nil
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package processing
|
||||
|
||||
import (
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
)
|
||||
|
||||
@ -49,9 +48,9 @@ func (wfa ProcessingMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int, erro
|
||||
return nil, code, err
|
||||
}
|
||||
for res_mongo.Next(mongo.MngoCtx) {
|
||||
var obj resources.AbstractResource
|
||||
var obj ProcessingResource
|
||||
res_mongo.Decode(&obj)
|
||||
objs = append(objs, &obj)
|
||||
objs = append(objs, &obj.AbstractResource)
|
||||
}
|
||||
return objs, 200, nil
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package storage
|
||||
|
||||
import (
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
)
|
||||
|
||||
@ -49,9 +48,9 @@ func (wfa StorageMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int, error)
|
||||
return nil, code, err
|
||||
}
|
||||
for res_mongo.Next(mongo.MngoCtx) {
|
||||
var obj resources.AbstractResource
|
||||
var obj StorageResource
|
||||
res_mongo.Decode(&obj)
|
||||
objs = append(objs, &obj)
|
||||
objs = append(objs, &obj.AbstractResource)
|
||||
}
|
||||
return objs, 200, nil
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package oclib
|
||||
|
||||
import (
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
)
|
||||
|
||||
@ -52,9 +51,9 @@ func (wfa WorkflowResourceMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int
|
||||
return nil, code, err
|
||||
}
|
||||
for res_mongo.Next(mongo.MngoCtx) {
|
||||
var obj resources.AbstractResource
|
||||
var obj WorkflowResource
|
||||
res_mongo.Decode(&obj)
|
||||
objs = append(objs, &obj)
|
||||
objs = append(objs, &obj.AbstractResource)
|
||||
}
|
||||
return objs, 200, nil
|
||||
}
|
||||
|
@ -100,9 +100,9 @@ func (wfa WorkflowMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int, error)
|
||||
return nil, code, err
|
||||
}
|
||||
for res_mongo.Next(mongo.MngoCtx) {
|
||||
var obj utils.AbstractObject
|
||||
var obj Workflow
|
||||
res_mongo.Decode(&obj)
|
||||
objs = append(objs, &obj)
|
||||
objs = append(objs, &obj.AbstractObject)
|
||||
}
|
||||
return objs, 200, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user