deserialize

This commit is contained in:
mr
2024-07-22 11:50:14 +02:00
parent a5741d5831
commit 6696b0faac
8 changed files with 1 additions and 78 deletions

View File

@@ -9,7 +9,7 @@ import (
type DatacenterResource struct {
resources.AbstractResource
BookingPrice int `bson:"booking_price" json:"booking_price"`
BookingPrice int `bson:"booking_price" json:"booking_price"`
CPU DatacenterCpuModel `bson:"cpu,omitempty" json:"cpu,omitempty"`
RAM DatacenterMemoryModel `bson:"ram,omitempty" json:"ram,omitempty"`
@@ -42,7 +42,6 @@ func (dma *DatacenterResource) Deserialize(j map[string]interface{}) utils.DBObj
return nil
}
json.Unmarshal(b, dma)
dma.AbstractResource.ObjDeserialize(j)
return dma
}
@@ -53,7 +52,6 @@ func (dma *DatacenterResource) Serialize() map[string]interface{} {
return nil
}
json.Unmarshal(b, dma)
dma.AbstractResource.ObjSerialize()
return m
}