25 lines
735 B
Go
25 lines
735 B
Go
// 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 {
|
|
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()
|
|
}
|