diff --git a/handler/async_task_create_handler.go b/handler/async_task_create_handler.go index d1ff912..9afa1d9 100644 --- a/handler/async_task_create_handler.go +++ b/handler/async_task_create_handler.go @@ -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 } diff --git a/model/attribute_model.go b/model/attribute_model.go index 601d156..6654dae 100644 --- a/model/attribute_model.go +++ b/model/attribute_model.go @@ -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 } diff --git a/model/model_select.go b/model/model_select.go index 042a867..ac38fca 100644 --- a/model/model_select.go +++ b/model/model_select.go @@ -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 diff --git a/model/redis_recommend.go b/model/redis_recommend.go index ddfef2a..95b0652 100644 --- a/model/redis_recommend.go +++ b/model/redis_recommend.go @@ -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 {