modelRT/model/model_select.go

23 lines
657 B
Go
Raw Normal View History

// Package model define model struct of model runtime service
package model
import (
"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 == constant.BusbarType {
return &orm.BusbarSection{}
} else if modelType == constant.AsyncMotorType {
return &orm.AsyncMotor{}
}
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()
}