Ver código fonte

配置文件

fengweiqiang 4 anos atrás
pai
commit
b9a4d75612

+ 7 - 3
udpdataclear/udpSensitiveWords/config.json

@@ -1,7 +1,10 @@
 {
-  "bidding_mgo_addr": "192.168.3.207:27092",
+  "85_mgo_addr": "192.168.3.207:27092",
   "mongodbPoolSize": 10,
   "collection": "result_20210109",
+  "163_mgo_addr": "172.17.4.187:27082,172.17.145.163:27083",
+  "163_userName": "fengweiqiang",
+  "163_passWord": "fwq@123123",
   "fields": {
     "buyer": 1,
     "agency": 1,
@@ -11,16 +14,17 @@
   "buyer_c": "",
   "agency_c": "",
   "winner_c": "",
-  "udpport": "1484",
+  "udpport": "1782",
   "nextNode": [
     {
       "addr": "127.0.0.1",
-      "port": 1485,
+      "port": 88888,
       "memo": "抽取城市"
     }
   ],
   "userName": "",
   "passWord": "",
+  "client_es": "http://172.17.4.84:9800",
   "es_type": "unique_qy",
   "es_index": "unique_qy"
 }

+ 0 - 3
udpdataclear/udpSensitiveWords/go.mod

@@ -6,14 +6,11 @@ require (
 	github.com/fortytw2/leaktest v1.3.0 // indirect
 	github.com/importcjj/sensitive v0.0.0-20200106142752-42d1c505be7b
 	github.com/mailru/easyjson v0.7.7 // indirect
-	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/olivere/elastic v6.2.35+incompatible // indirect
 	github.com/prometheus/client_golang v1.10.0
-	github.com/spf13/pflag v1.0.3 // indirect
 	go.mongodb.org/mongo-driver v1.5.1
 	google.golang.org/grpc v1.36.1
 	google.golang.org/protobuf v1.26.0
-	gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
 	gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
 	gopkg.in/olivere/elastic.v1 v1.0.1
 )

+ 3 - 3
udpdataclear/udpSensitiveWords/util/config.go

@@ -16,7 +16,7 @@ func InitC() {
 	}
 
 	QfwMgo85 = &MongodbSim{
-		MongodbAddr: Config["bidding_mgo_addr"].(string),
+		MongodbAddr: Config["85_mgo_addr"].(string),
 		Size:        IntAll(Config["mongodbPoolSize"]),
 		DbName:      "qfw",
 		UserName:    Config["userName"].(string),
@@ -24,8 +24,8 @@ func InitC() {
 	}
 	QfwMgo85.InitPool()
 
-	//Client_Es, _ = elastic.NewClient(http.DefaultClient, "http://192.168.3.11:9800")
-	Client_Es, _ = elastic.NewClient(http.DefaultClient, "http://ela.spdata.jianyu360.com")
+	//Client_Es, _ = elastic.NewClient(http.DefaultClient, "http://192.168.3.11:9800")"http://ela.spdata.jianyu360.com"
+	Client_Es, _ = elastic.NewClient(http.DefaultClient, Config["client_es"].(string))
 
 	es_type, es_index = Config["es_type"].(string), Config["es_index"].(string)
 

+ 2 - 2
udpdataclear/udpSensitiveWords/util/udpdata.go

@@ -249,7 +249,7 @@ func AddTaskSensitiveWordsData() {
 		}
 	}()
 
-	mmmgo, err := InitMgoEn("mongodb://172.17.4.187:27082,172.17.145.163:27083", 20, "fengweiqiang", "fwq@123123")
+	mmmgo, err := InitMgoEn("mongodb://"+Config["163_mgo_addr"].(string), 10, Config["163_userName"].(string), Config["163_passWord"].(string))
 	if err != nil {
 		log.Fatalln(err)
 	}
@@ -276,7 +276,7 @@ func AddTaskSensitiveWordsData() {
 
 					if strReg.MatchString(company_name) || !unstart_strReg.MatchString(company_name) ||
 						con_strReg.MatchString(company_name) {
-						return
+						continue
 					}
 					//存mgo
 					new_tmp ,err:= con.Database("mixdata").Collection("unique_qyxy").InsertOne(nil, bson.M{