modelRT/model/model_select.go

25 lines
735 B
Go
Raw Normal View History

// Package model define model struct of model runtime service
package model
import (
constants "modelRT/constant"
"modelRT/orm"
)
// SelectModelByType define select the data structure for parsing based on the input model type
func SelectModelByType(modelType int) BasicModelInterface {
if modelType == constants.BusbarType {
return &orm.BusbarSection{}
} else if modelType == constants.AsyncMotorType {
return &orm.AsyncMotor{}
} else if modelType == constants.DemoType {
2024-12-18 16:25:49 +08:00
return &orm.Demo{}
}
return nil
}
// SelectModelNameByType define select the data structure name for parsing based on the input model type
func SelectModelNameByType(modelType int) string {
return SelectModelByType(modelType).ReturnTableName()
}