|
@@ -1,71 +1,64 @@
|
|
|
package models
|
|
|
|
|
|
-import (
|
|
|
- "eta_gn/eta_chart_lib/models/data_manage"
|
|
|
- "eta_gn/eta_chart_lib/models/data_manage/future_good"
|
|
|
- "eta_gn/eta_chart_lib/utils"
|
|
|
- "time"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- _ "github.com/go-sql-driver/mysql"
|
|
|
+
|
|
|
|
|
|
- "github.com/beego/beego/v2/client/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.Debug = true
|
|
|
- orm.DebugLog = orm.NewLog(utils.Binlog)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- orm.RegisterModel(
|
|
|
- new(data_manage.EdbInfo),
|
|
|
- new(ShareChartRefreshLog),
|
|
|
- new(ExcelInfo),
|
|
|
- new(data_manage.PredictEdbConf),
|
|
|
- new(data_manage.PredictEdbRuleData),
|
|
|
- new(data_manage.PredictEdbConfCalculateMapping),
|
|
|
- new(data_manage.ChartInfoCorrelation),
|
|
|
- new(FactorEdbSeriesCalculateDataQjjs),
|
|
|
- )
|
|
|
-
|
|
|
- initFutureGood()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- afterInitTable()
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-func initFutureGood() {
|
|
|
-
|
|
|
- orm.RegisterModel(
|
|
|
- new(future_good.FutureGoodEdbInfo),
|
|
|
- new(future_good.FutureGoodEdbData),
|
|
|
- new(future_good.ChartInfoFutureGoodProfit),
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-func afterInitTable() {
|
|
|
-
|
|
|
- data_manage.InitEdbSourceVar()
|
|
|
-
|
|
|
-
|
|
|
- InitUseMongoConf()
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|