Ver código fonte

feat: 去除打印信息

gaoyagang 1 ano atrás
pai
commit
4adaca22f6
3 arquivos alterados com 2 adições e 8 exclusões
  1. 1 1
      envitem/func_test.go
  2. 0 6
      identify/single.go
  3. 1 1
      identify/single_test.go

+ 1 - 1
envitem/func_test.go

@@ -11,7 +11,7 @@ func TestEnvItem_GetCurrentData(t *testing.T) {
 	SetOptions(Options{GtServerIp: "120.55.44.4:8900"})
 	e := EnvItem{
 		ProjectId: 92,
-		Item:      "C.M.UF2_BHGF@fault_total",
+		Item:      "C.M.UF1_DB@press_PV",
 	}
 
 	v, ht, err := e.getCurrentValue()

+ 0 - 6
identify/single.go

@@ -145,7 +145,6 @@ func (s *SingleItem) nvNotIn(slice []ItemValue) bool {
 func (s *SingleItem) inSlice(slice []ItemValue, v ItemValue) bool {
 	for _, s2 := range slice {
 		s1 := s.transVar(s2)
-		println(s1)
 		if s1 == v {
 			return true
 		}
@@ -185,8 +184,6 @@ func (s *SingleItem) transVar(v ItemValue) ItemValue {
 }
 
 func (s *SingleItem) compare(r string, v string) bool {
-	println(r)
-	println(v)
 	if strings.Index(r, "...") > -1 {
 		return s.compareRange(r, v)
 	} else if strings.Index(r, " ") > 1 {
@@ -322,9 +319,6 @@ func (s *SingleItem) calc(v string) string {
 }
 
 func (s *SingleItem) compareLogic(r string, v string) bool {
-	println(r)
-	println(v)
-
 	rl := strings.Split(r, " ")
 	if len(rl) != 2 {
 		return false

+ 1 - 1
identify/single_test.go

@@ -12,7 +12,7 @@ func TestStepTest(t *testing.T) {
 
 func TestStepTest1(t *testing.T) {
 	// 值逻辑比较 > 0.3的情况
-	rule := `{"xxx":{"NvIn":[">= 0.3"]}}`
+	rule := `{"xxx":{"NvIn":["> 0.3"]}}`
 	x := StepTest("0", "0.31", rule)
 	t.Log(x)
 }