This commit is contained in:
mr
2024-07-19 13:27:34 +02:00
parent cdc077c59e
commit 3f9814e649
9 changed files with 22 additions and 0 deletions

View File

@@ -17,6 +17,10 @@ type AbstractObject struct {
Name string `json:"name" required:"true" bson:"name" validate:"required"`
}
func (ao *AbstractObject) GetID() string {
return ao.UUID
}
func (dma *AbstractObject) ObjDeserialize(j map[string]interface{}) *AbstractObject {
b, err := json.Marshal(j)
if err != nil {

View File

@@ -2,6 +2,8 @@ package utils
type DBObject interface {
GenerateID()
GetID() string
BindID(id string)
GetName() string
Deserialize(j map[string]interface{}) DBObject
Serialize() map[string]interface{}