package main

import (
	log "github.com/donnie4w/go-logger/logger"
)

var data_mgo *MongodbSim
var IsLocal bool

func initMgo() {
	if IsLocal {
		data_mgo = &MongodbSim{
			MongodbAddr: "127.0.0.1:27017",
			DbName:      "zhengkun",
			Size:        10,
			UserName:    "",
			Password:    "",
		}
		data_mgo.InitPool()
	} else {
		data_mgo = &MongodbSim{
			MongodbAddr: "172.17.145.163:27083,172.17.4.187:27082",
			DbName:      "qfw",
			Size:        10,
			UserName:    "zhengkun",
			Password:    "zk@123123",
		}
		data_mgo.InitPool()
	}
}

func init() {
	IsLocal = true
	initMgo()
	initReadyInfo()
}

func main() {
	log.Debug("main...")
	//准备代码表
	//prparePurClassCode()
	//prepareReplenishInfo()
	//prepareBasicInfo()

	//prepareMedicalNameClass()

	//标讯信息打分类
	//BeaconInfoPurchasingClass()
	//TestBeaconInfoPurchasingClass("5feede7ec2c0c99d52d6c13f")
	//testEsQuery()

	lock := make(chan bool)
	<-lock
}

func test() {
	//dataArr, _ := data_mgo.Find("111111", nil, nil, nil)
	//for _, v := range dataArr {
	//	code := qu.ObjToString(v["code"])
	//	tmpid := BsonTOStringId(v["_id"])
	//	update := map[string]interface{}{}
	//	class_1, class_2, class_3, class_4, class_5 := relevanceEntireClassCode(code)
	//	update["class_1"] = class_1
	//	update["class_2"] = class_2
	//	update["class_3"] = class_3
	//	update["class_4"] = class_4
	//	update["class_5"] = class_5
	//	data_mgo.UpdateById("111111", tmpid, map[string]interface{}{
	//		"$set": update,
	//	})
	//}
}
