package models import ( _ "github.com/go-sql-driver/mysql" "hongze/hongze_chart_lib/models/data_manage" "hongze/hongze_chart_lib/utils" "time" "github.com/rdlucklib/rdluck_tools/orm" ) func init() { _ = orm.RegisterDataBase("default", "mysql", utils.MYSQL_URL) orm.SetMaxIdleConns("default", 50) orm.SetMaxOpenConns("default", 100) db, _ := orm.GetDB("default") db.SetConnMaxLifetime(10 * time.Minute) _ = orm.RegisterDataBase("data", "mysql", utils.MYSQL_URL_DATA) orm.SetMaxIdleConns("data", 50) orm.SetMaxOpenConns("data", 100) data_db, _ := orm.GetDB("data") data_db.SetConnMaxLifetime(10 * time.Minute) _ = orm.RegisterDataBase("edb", "mysql", utils.MYSQL_URL_EDB) orm.SetMaxIdleConns("edb", 50) orm.SetMaxOpenConns("edb", 100) edb_db, _ := orm.GetDB("edb") edb_db.SetConnMaxLifetime(10 * time.Minute) //注册对象 orm.RegisterModel( new(data_manage.EdbClassify), new(data_manage.EdbInfo), new(data_manage.EdbDataThs), new(data_manage.EdbDataWind), new(data_manage.EdbDataPb), new(data_manage.ChartClassify), new(data_manage.ChartInfo), new(data_manage.ChartEdbMapping), new(data_manage.ManualUserClassify), new(data_manage.EdbdataClassify), new(data_manage.ManualUser), new(data_manage.EdbInfoCalculate), new(data_manage.EdbDataCalculate), new(data_manage.EdbInfoCalculateLjzzy), new(data_manage.EdbInfoCalculateTbz), new(data_manage.EdbInfoCalculateTcz), new(data_manage.EdbInfoCalculateNszydpjjs), new(data_manage.SearchKeyword), new(data_manage.EdbInfoCalculateHbz), new(data_manage.EdbInfoCalculateHcz), new(data_manage.EdbInfoCalculateBp), new(data_manage.BaseFromSmm), new(data_manage.BaseFromSmmIndex), new(data_manage.BaseFromSmmData), new(data_manage.MyChartClassify), new(data_manage.MyChart), new(data_manage.MyChartClassifyMapping), new(data_manage.ChartInfoLog), new(data_manage.EdbInfoLog), new(data_manage.MyChartLog), new(data_manage.EdbInfoCalculateMapping), new(data_manage.EdbDataCalculateZjpj), //直接拼接 new(data_manage.EdbDataCalculateLjztbpj), //累计同比值拼接 new(ShareChartRefreshLog), //分享图表刷新日志表 ) }