From 5f735b6e9db45b6d688ed3e01d9a7e170c851882 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 1 Oct 2024 09:16:56 +0200 Subject: [PATCH] No more value in resource --- models/resource_model/resource_model.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/models/resource_model/resource_model.go b/models/resource_model/resource_model.go index 3769448..40b6468 100644 --- a/models/resource_model/resource_model.go +++ b/models/resource_model/resource_model.go @@ -26,19 +26,6 @@ type AbstractResource struct { ResourceModel *ResourceModel `json:"resource_model,omitempty" bson:"resource_model,omitempty"` // ResourceModel is the model of the resource } -/* -* GetModelValue returns the value of the model key - */ -func (abs *AbstractResource) GetModelValue(cat string, key string) interface{} { - if abs.ResourceModel == nil || abs.ResourceModel.Model == nil { - return nil - } - if _, ok := abs.ResourceModel.Model[key]; !ok { - return nil - } - return abs.ResourceModel.Model[cat][key].Value -} - /* * GetModelType returns the type of the model key */ @@ -77,9 +64,8 @@ func (abs *AbstractResource) GetModelReadOnly(cat string, key string) interface{ } type Model struct { - Type string `json:"type,omitempty" bson:"type,omitempty"` // Type is the type of the model - Value interface{} `json:"value,omitempty" bson:"value,omitempty"` // Value is the value of the model - ReadOnly bool `json:"readonly,omitempty" bson:"readonly,omitempty"` // ReadOnly is the readonly of the model + Type string `json:"type,omitempty" bson:"type,omitempty"` // Type is the type of the model + ReadOnly bool `json:"readonly,omitempty" bson:"readonly,omitempty"` // ReadOnly is the readonly of the model } /*