No more value in resource

This commit is contained in:
mr 2024-10-01 09:16:56 +02:00
parent f490dc3555
commit 5f735b6e9d

View File

@ -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
}
/*