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