kick out print

This commit is contained in:
mr 2024-08-05 10:10:58 +02:00
parent 1e8cb98098
commit dd5f8f5b2d
3 changed files with 27 additions and 1 deletions

View File

@ -59,7 +59,7 @@ func (wfa *ResourceModelMongoAccessor) Search(filters *dbs.Filters, search strin
if (filters == nil || len(filters.And) == 0 || len(filters.Or) == 0) && search != "" {
filters = &dbs.Filters{
Or: map[string][]dbs.Filter{
"resource_type": []dbs.Filter{{Operator: dbs.LIKE.String(), Value: search}},
"resource_type": {{Operator: dbs.LIKE.String(), Value: search}},
},
}
}

View File

@ -1,6 +1,7 @@
package utils
import (
"encoding/json"
"errors"
"cloud.o-forge.io/core/oc-lib/dbs"
@ -26,6 +27,29 @@ func (ao *AbstractObject) GetName() string {
return ao.Name
}
func (dma *AbstractObject) GetAccessor() Accessor {
return nil
}
func (dma *AbstractObject) Deserialize(j map[string]interface{}) DBObject {
b, err := json.Marshal(j)
if err != nil {
return nil
}
json.Unmarshal(b, dma)
return dma
}
func (dma *AbstractObject) Serialize() map[string]interface{} {
var m map[string]interface{}
b, err := json.Marshal(dma)
if err != nil {
return nil
}
json.Unmarshal(b, &m)
return m
}
func (r *AbstractObject) GenerateID() {
r.UUID = uuid.New().String()
}

View File

@ -6,6 +6,8 @@ type ShallowDBObject interface {
GenerateID()
GetID() string
GetName() string
Deserialize(j map[string]interface{}) DBObject
Serialize() map[string]interface{}
}
type DBObject interface {