Compare commits
1 Commits
develop
...
refactor/o
| Author | SHA1 | Date |
|---|---|---|
|
|
61e5f9bf39 |
|
|
@ -2,6 +2,8 @@
|
|||
package handler
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"modelRT/constants"
|
||||
"modelRT/database"
|
||||
"modelRT/logger"
|
||||
|
|
@ -152,6 +154,7 @@ func validateBatchImportParams(params map[string]any) bool {
|
|||
func validateTestTaskParams(params map[string]any) bool {
|
||||
// Test task has optional parameters, all are valid
|
||||
// sleep_duration defaults to 60 seconds if not provided
|
||||
fmt.Println("Test task parameters:", params)
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,6 +90,6 @@ func (s *ShortAttrInfo) IsLocal() bool {
|
|||
}
|
||||
|
||||
// GetAttrValue define return the attribute value
|
||||
func (l *ShortAttrInfo) GetAttrValue() any {
|
||||
return l.AttrValue
|
||||
func (s *ShortAttrInfo) GetAttrValue() any {
|
||||
return s.AttrValue
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,12 @@ import (
|
|||
|
||||
// SelectModelByType define select the data structure for parsing based on the input model type
|
||||
func SelectModelByType(modelType int) BasicModelInterface {
|
||||
if modelType == constants.BusbarType {
|
||||
switch modelType {
|
||||
case constants.BusbarType:
|
||||
return &orm.BusbarSection{}
|
||||
} else if modelType == constants.AsyncMotorType {
|
||||
case constants.AsyncMotorType:
|
||||
return &orm.AsyncMotor{}
|
||||
} else if modelType == constants.DemoType {
|
||||
case constants.DemoType:
|
||||
return &orm.Demo{}
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -618,13 +618,14 @@ func runFuzzySearch(ctx context.Context, rdb *redis.Client, searchInput string,
|
|||
}
|
||||
}
|
||||
|
||||
if recommendLenType == constants.FullRecommendLength {
|
||||
switch recommendLenType {
|
||||
case constants.FullRecommendLength:
|
||||
if result.Term == "" {
|
||||
termHierarchyLen = 1
|
||||
} else {
|
||||
termHierarchyLen = strings.Count(result.Term, ".") + 1
|
||||
}
|
||||
} else if recommendLenType == constants.IsLocalRecommendLength {
|
||||
case constants.IsLocalRecommendLength:
|
||||
if result.Term == "" {
|
||||
termHierarchyLen = 4
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue