1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- package models
- import (
- "eta/eta_task/models/data_manage"
- "eta/eta_task/models/data_manage/future_good"
- "eta/eta_task/utils"
- _ "github.com/go-sql-driver/mysql"
- "time"
- "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.Debug = true
- orm.DebugLog = orm.NewLog(utils.Binlog)
-
- initEdbDataTable()
-
- initFutureGoodEdbDataTable()
-
- initTradePositionTop()
- }
- func initEdbDataTable() {
-
- orm.RegisterModel(
- new(data_manage.EdbDataWind),
- new(data_manage.EdbDataThs),
- new(data_manage.EdbDataPb),
- new(data_manage.BaseFromSmm),
- new(data_manage.BaseFromSmmIndex),
- new(data_manage.BaseFromSmmData),
- new(data_manage.EdbDataYs),
- new(data_manage.EdbInfoCalculateMapping),
- new(data_manage.EdbInfo),
- new(data_manage.EdbDataCalculateZjpj),
- new(data_manage.EdbDataCalculateLjztbpj),
- new(data_manage.BaseFromTradeZhengzhouIndex),
- new(data_manage.BaseFromTradeDalianIndex),
- new(data_manage.BaseFromTradeShanghaiIndex),
- new(data_manage.BaseFromTradeCffexIndex),
- new(data_manage.BaseFromTradeIneIndex),
- new(data_manage.BaseFromChangesVisitorsCovid),
- new(data_manage.BaseFromEiaSteoIndex),
- new(data_manage.BaseFromEiaSteoData),
- new(data_manage.ComTradeIndex),
- new(data_manage.ComTradeCodeMapping),
- new(data_manage.ComTradeData),
- )
- }
- func initFutureGoodEdbDataTable() {
-
- orm.RegisterModel(
- new(future_good.FutureGoodEdbInfo),
- )
- }
- func initTradePositionTop() {
-
- orm.RegisterModel(
- new(data_manage.TradePositionDalianTop),
- new(data_manage.TradePositionZhengzhouTop),
- new(data_manage.TradePositionShanghaiTop),
- new(data_manage.TradePositionIneTop),
- new(data_manage.TradePositionCffexTop),
- new(data_manage.BaseFromTradeClassify),
- )
- }
|