|
@@ -1,236 +1,8 @@
|
|
|
package models
|
|
|
|
|
|
import (
|
|
|
- "eta_gn/eta_index_lib/models/data_stat"
|
|
|
- "eta_gn/eta_index_lib/models/edb_refresh"
|
|
|
- "eta_gn/eta_index_lib/models/excel"
|
|
|
- "eta_gn/eta_index_lib/models/future_good"
|
|
|
- "eta_gn/eta_index_lib/models/supply_analysis"
|
|
|
- "eta_gn/eta_index_lib/utils"
|
|
|
- "time"
|
|
|
-
|
|
|
- "github.com/beego/beego/v2/client/orm"
|
|
|
_ "github.com/go-sql-driver/mysql"
|
|
|
)
|
|
|
|
|
|
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("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.RegisterDataBase("gl", "mysql", utils.MYSQL_URL_GL)
|
|
|
- orm.SetMaxIdleConns("gl", 50)
|
|
|
- orm.SetMaxOpenConns("gl", 100)
|
|
|
-
|
|
|
- gl, _ := orm.GetDB("gl")
|
|
|
- gl.SetConnMaxLifetime(10 * time.Minute)
|
|
|
-
|
|
|
-
|
|
|
- {
|
|
|
- _ = orm.RegisterDataBase("master", "mysql", utils.MYSQL_URL_MASTER)
|
|
|
- orm.SetMaxIdleConns("master", 50)
|
|
|
- orm.SetMaxOpenConns("master", 100)
|
|
|
-
|
|
|
- master, _ := orm.GetDB("master")
|
|
|
- master.SetConnMaxLifetime(10 * time.Minute)
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- orm.Debug = true
|
|
|
- orm.DebugLog = orm.NewLog(utils.Binlog)
|
|
|
-
|
|
|
-
|
|
|
- orm.RegisterModel(
|
|
|
- new(EdbDataCalculateZjpj),
|
|
|
- new(EdbDataCalculateLjztbpj),
|
|
|
- new(EdbInfo),
|
|
|
- new(EdbInfoRecord),
|
|
|
- new(BaseFromSmmRecord),
|
|
|
- new(BaseFromMysteelChemicalRecord),
|
|
|
- new(EdbInfoCalculateMapping),
|
|
|
- new(EdbPythonCode),
|
|
|
- new(EdbDataPython),
|
|
|
- new(ChartEdbMapping),
|
|
|
- new(PredictEdbConf),
|
|
|
- new(EdbClassify),
|
|
|
- new(PredictEdbConfCalculateMapping),
|
|
|
- new(PredictEdbRuleData),
|
|
|
- new(EdbDataCalculateNhcc),
|
|
|
- new(EdbDataPredictCalculateLjztbpj),
|
|
|
- new(EdbDataPredictCalculateNhcc),
|
|
|
- new(EdbDataPredictCalculateZjpj),
|
|
|
- new(EdbDataInsertConfig),
|
|
|
- new(EdbAdjustConf),
|
|
|
- new(BaseFromMysteelChemicalClassify),
|
|
|
- new(EdbInfoRelation),
|
|
|
- )
|
|
|
-
|
|
|
-
|
|
|
- initFutureGood()
|
|
|
-
|
|
|
-
|
|
|
- initSupplyAnalysis()
|
|
|
-
|
|
|
-
|
|
|
- initBaseIndex()
|
|
|
-
|
|
|
-
|
|
|
- initDataStat()
|
|
|
-
|
|
|
-
|
|
|
- initExcel()
|
|
|
-
|
|
|
-
|
|
|
- initEdbRefresh()
|
|
|
-
|
|
|
-
|
|
|
- initBusinessEdb()
|
|
|
-
|
|
|
-
|
|
|
- initFactorEdbSeries()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-func initFutureGood() {
|
|
|
-
|
|
|
- orm.RegisterModel(
|
|
|
- new(future_good.FutureGoodEdbInfo),
|
|
|
- new(future_good.FutureGoodEdbData),
|
|
|
- new(future_good.ChartInfoFutureGoodProfit),
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-func initSupplyAnalysis() {
|
|
|
- orm.RegisterModel(
|
|
|
- new(supply_analysis.Variety),
|
|
|
- new(supply_analysis.VarietyAdminPermission),
|
|
|
- new(supply_analysis.VarietyEdbInfo),
|
|
|
- new(supply_analysis.VarietyPlant),
|
|
|
- new(supply_analysis.BaseFromStockPlantData),
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-func initBaseIndex() {
|
|
|
- orm.RegisterModel(
|
|
|
- new(BaseFromSciIndex),
|
|
|
- new(BaseFromSciData),
|
|
|
- new(BaseFromBaiinfoIndex),
|
|
|
- new(BaseFromBaiinfoData),
|
|
|
- new(BaseFromSmmIndex),
|
|
|
- new(BaseFromSmmData),
|
|
|
- new(BaseFromMysteelChemicalIndex),
|
|
|
- new(BaseFromMysteelChemicalData),
|
|
|
- new(BaseFromTradeShanghaiIndex),
|
|
|
- new(BaseFromTradeIneIndex),
|
|
|
- new(BaseFromSmmClassify),
|
|
|
- new(BaseFromYongyiIndex),
|
|
|
- new(BaseFromYongyiData),
|
|
|
- new(BaseFromYongyiClassify),
|
|
|
- new(BaseFromCoalmineMapping),
|
|
|
- new(BaseFromCoalmineJsmIndex),
|
|
|
- new(BaseFromCoalmineCoastalIndex),
|
|
|
- new(BaseFromCoalmineInlandIndex),
|
|
|
- new(BaseFromCoalmineCompanyIndex),
|
|
|
- new(BaseFromCoalmineFirmIndex),
|
|
|
- new(BaseFromMtjhMapping),
|
|
|
- new(BaseFromMtjhIndex),
|
|
|
- new(BaseFromFenweiIndex),
|
|
|
- new(BaseFromFenweiData),
|
|
|
- new(BaseFromBloombergIndex),
|
|
|
- new(BaseFromBloombergData),
|
|
|
- new(BaseFromSci99Data),
|
|
|
- new(BaseFromSci99Index),
|
|
|
- new(BaseFromSci99Classify),
|
|
|
- new(BaseFromCCFIndex),
|
|
|
- new(BaseFromCCFData),
|
|
|
- new(CCFStockExcel),
|
|
|
- new(BaseFromSciHqData),
|
|
|
- new(BaseFromSciHqIndex),
|
|
|
- new(BaseFromThsHfIndex),
|
|
|
- new(BaseFromThsHfData),
|
|
|
- new(BaseFromEdbMapping),
|
|
|
- new(EdbDataThsHf),
|
|
|
- new(BaseFromBusinessData),
|
|
|
- new(BaseFromOilchemIndex),
|
|
|
- new(BaseFromOilchemData),
|
|
|
- new(BaseFromFenweiClassify),
|
|
|
- new(EdbDataTradeAnalysis),
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-func initDataStat() {
|
|
|
- orm.RegisterModel(
|
|
|
- new(data_stat.EdbInfoUpdateLog),
|
|
|
- new(data_stat.EdbInfoUpdateStat),
|
|
|
- new(data_stat.EdbSourceStat),
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-func initExcel() {
|
|
|
- orm.RegisterModel(
|
|
|
- new(excel.ExcelInfo),
|
|
|
- new(excel.ExcelClassify),
|
|
|
- new(excel.ExcelEdbMapping),
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-func initEdbRefresh() {
|
|
|
- orm.RegisterModel(
|
|
|
- new(edb_refresh.EdbRefreshSource),
|
|
|
- new(edb_refresh.EdbRefreshDefaultConfig),
|
|
|
- new(edb_refresh.EdbRefreshConfig),
|
|
|
- new(edb_refresh.EdbRefreshMapping),
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-func initBusinessEdb() {
|
|
|
- orm.RegisterModel(
|
|
|
- new(BaseFromBusinessIndex),
|
|
|
- new(EdbBusinessSource),
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-func initFactorEdbSeries() {
|
|
|
- orm.RegisterModel(
|
|
|
- new(FactorEdbSeries),
|
|
|
- new(FactorEdbSeriesChartMapping),
|
|
|
- new(FactorEdbSeriesMapping),
|
|
|
- new(FactorEdbSeriesCalculateData),
|
|
|
- new(FactorEdbSeriesCalculateDataQjjs),
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- InitEdbSource()
|
|
|
-
|
|
|
-
|
|
|
- InitUseMongoConf()
|
|
|
-
|
|
|
-
|
|
|
- InitSmmDataMethodConf()
|
|
|
-}*/
|