package main

import "time"

var (
	save_mgo,qy_mgo,spi_mgo		*MongodbSim
	isLocal	bool
)
//初始化mgo
func initMgo() {
	if isLocal {
		save_mgo = &MongodbSim{
			MongodbAddr: "127.0.0.1:27017",
			DbName:      "zhengkun",
			Size:        10,
			UserName: "",
			Password: "",
		}
		save_mgo.InitPool()

		qy_mgo = &MongodbSim{
			MongodbAddr: "127.0.0.1:27017",
			DbName:      "mixdata",
			Size:        10,
			UserName: "",
			Password: "",
		}
		qy_mgo.InitPool()

		spi_mgo = &MongodbSim{
			MongodbAddr: "127.0.0.1:27017",
			DbName:      "zhengkun",
			Size:        10,
			UserName: "",
			Password: "",
		}
		spi_mgo.InitPool()
	}else {
		//save_mgo = &MongodbSim{
		//	MongodbAddr: "172.17.4.85:27080",
		//	DbName:      "qfw",
		//	Size:        10,
		//	UserName: "",
		//	Password: "",
		//}
		//save_mgo.InitPool()

		save_mgo = &MongodbSim{
			MongodbAddr: "172.17.4.87:27080",
			DbName:      "hospital",
			Size:        10,
			UserName: "",
			Password: "",
		}
		save_mgo.InitPool()

		qy_mgo = &MongodbSim{
			MongodbAddr: "172.17.145.163:27083,172.17.4.187:27082",
			DbName:      "mixdata",
			Size:        10,
			UserName: "zhengkun",
			Password: "zk@123123",
		}
		qy_mgo.InitPool()

		spi_mgo = &MongodbSim{
			MongodbAddr: "172.17.4.181:27001",
			DbName:      "mixdata",
			Size:        10,
			UserName: "",
			Password: "",
		}
		spi_mgo.InitPool()
	}
}


func init()  {
	//isLocal = true //本地
	initMgo()
}
func main(){
	dealWithTermHospital()
	time.Sleep(999*time.Hour)
}







func test()  {
	//dealWithDataFieldAccuracy("a_marked_bidding_old")
	//increaseTemplateData("zktest_upload_data","zktest_upload_data")

	//var port, path string
	//flag.StringVar(&port, "port", "8088", "端口")
	//flag.StringVar(&path, "path", "/", "路径")
	//flag.Parse()
	//http.Handle("/", http.FileServer(http.Dir(path)))
	//log.Debug("port:", port)
	//http.ListenAndServe(":"+port, nil)
}



