modelRT/model/model_select.go

24 lines
664 B
Go

package model
import (
"modelRT/constants"
"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 {
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()
}