2024-12-02 16:13:16 +08:00
|
|
|
// Package model define model struct of model runtime service
|
2024-11-22 16:41:04 +08:00
|
|
|
package model
|
|
|
|
|
|
2024-12-02 16:13:16 +08:00
|
|
|
import (
|
|
|
|
|
"modelRT/constant"
|
|
|
|
|
"modelRT/orm"
|
|
|
|
|
)
|
2024-11-22 16:41:04 +08:00
|
|
|
|
2024-12-02 16:13:16 +08:00
|
|
|
// SelectModelByType define select the data structure for parsing based on the input model type
|
2024-12-04 15:57:11 +08:00
|
|
|
func SelectModelByType(modelType int) BasicModelInterface {
|
2024-12-02 16:13:16 +08:00
|
|
|
if modelType == constant.BusbarType {
|
|
|
|
|
return &orm.BusbarSection{}
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SelectModelNameByType define select the data structure name for parsing based on the input model type
|
|
|
|
|
func SelectModelNameByType(modelType int) string {
|
2024-11-22 16:41:04 +08:00
|
|
|
if modelType == constant.BusbarType {
|
|
|
|
|
return "BusBarSection"
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|