A question refers to the comment ! And if not Ooopsy
This commit is contained in:
@@ -19,6 +19,10 @@ import (
|
||||
"cloud.o-forge.io/core/oc-lib/models/workspace/shared/rules/rule"
|
||||
)
|
||||
|
||||
/*
|
||||
This package contains the models used in the application
|
||||
It's used to create the models dynamically
|
||||
*/
|
||||
var models = map[string]func() utils.DBObject{
|
||||
utils.WORKFLOW_RESOURCE.String(): func() utils.DBObject { return &w.WorkflowResource{} },
|
||||
utils.DATA_RESOURCE.String(): func() utils.DBObject { return &d.DataResource{} },
|
||||
@@ -35,6 +39,7 @@ var models = map[string]func() utils.DBObject{
|
||||
utils.BOOKING.String(): func() utils.DBObject { return &booking.Booking{} },
|
||||
}
|
||||
|
||||
// Model returns the model object based on the model type
|
||||
func Model(model int) utils.DBObject {
|
||||
log := logs.GetLogger()
|
||||
if _, ok := models[utils.FromInt(model)]; ok {
|
||||
@@ -44,6 +49,7 @@ func Model(model int) utils.DBObject {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetModelsNames returns the names of the models
|
||||
func GetModelsNames() []string {
|
||||
names := []string{}
|
||||
for name := range models {
|
||||
|
||||
Reference in New Issue
Block a user