set up print
This commit is contained in:
parent
c7f65914bb
commit
956af8f5f5
@ -1,6 +1,8 @@
|
|||||||
package oclib
|
package oclib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||||
"cloud.o-forge.io/core/oc-lib/logs"
|
"cloud.o-forge.io/core/oc-lib/logs"
|
||||||
"cloud.o-forge.io/core/oc-lib/models"
|
"cloud.o-forge.io/core/oc-lib/models"
|
||||||
@ -102,6 +104,7 @@ func DeleteOne(collection LibDataEnum, id string) LibData {
|
|||||||
|
|
||||||
func StoreOne(collection LibDataEnum, object map[string]interface{}) LibData {
|
func StoreOne(collection LibDataEnum, object map[string]interface{}) LibData {
|
||||||
model := models.Model(collection.EnumIndex())
|
model := models.Model(collection.EnumIndex())
|
||||||
|
fmt.Println(object)
|
||||||
d, code, err := model.GetAccessor().StoreOne(model.Deserialize(object))
|
d, code, err := model.GetAccessor().StoreOne(model.Deserialize(object))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return LibData{Data: d, Code: code, Err: err.Error()}
|
return LibData{Data: d, Code: code, Err: err.Error()}
|
||||||
|
@ -18,10 +18,9 @@ type StorageResource struct {
|
|||||||
Size uint `bson:"size,omitempty" json:"size,omitempty"`
|
Size uint `bson:"size,omitempty" json:"size,omitempty"`
|
||||||
Url *URL `bson:"url,omitempty" json:"url,omitempty"` // Will allow to select between several protocols
|
Url *URL `bson:"url,omitempty" json:"url,omitempty"` // Will allow to select between several protocols
|
||||||
|
|
||||||
Encryption bool `bson:"encryption,omitempty" json:"encryption,omitempty"`
|
Encryption bool `bson:"encryption,omitempty" json:"encryption,omitempty"`
|
||||||
Redundancy string `bson:"redundancy,omitempty" json:"redundancy,omitempty"`
|
Redundancy string `bson:"redundancy,omitempty" json:"redundancy,omitempty"`
|
||||||
Throughput string `bson:"throughput,omitempty" json:"throughput,omitempty"`
|
Throughput string `bson:"throughput,omitempty" json:"throughput,omitempty"`
|
||||||
BookingPrice uint `bson:"booking_price,omitempty" json:"booking_price,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dma *StorageResource) Deserialize(j map[string]interface{}) utils.DBObject {
|
func (dma *StorageResource) Deserialize(j map[string]interface{}) utils.DBObject {
|
||||||
|
@ -2,6 +2,7 @@ package oclib
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"slices"
|
"slices"
|
||||||
|
|
||||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||||
@ -65,6 +66,7 @@ func (wfa *WorkflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (util
|
|||||||
if code, err := wfa.execution(set.(*Workflow), true); err != nil {
|
if code, err := wfa.execution(set.(*Workflow), true); err != nil {
|
||||||
return nil, code, err
|
return nil, code, err
|
||||||
}
|
}
|
||||||
|
fmt.Println(set.Serialize())
|
||||||
return wfa.GenericUpdateOne(set, id, wfa, &Workflow{})
|
return wfa.GenericUpdateOne(set, id, wfa, &Workflow{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user