|
@@ -5,6 +5,7 @@ import (
|
|
_ "github.com/go-sql-driver/mysql"
|
|
_ "github.com/go-sql-driver/mysql"
|
|
"hongze/hongze_open_api/models/tables"
|
|
"hongze/hongze_open_api/models/tables"
|
|
"hongze/hongze_open_api/models/tables/admin"
|
|
"hongze/hongze_open_api/models/tables/admin"
|
|
|
|
+ "hongze/hongze_open_api/models/tables/business_conf"
|
|
"hongze/hongze_open_api/models/tables/company"
|
|
"hongze/hongze_open_api/models/tables/company"
|
|
"hongze/hongze_open_api/models/tables/company_product"
|
|
"hongze/hongze_open_api/models/tables/company_product"
|
|
"hongze/hongze_open_api/models/tables/cygx/article"
|
|
"hongze/hongze_open_api/models/tables/cygx/article"
|
|
@@ -44,6 +45,15 @@ func init() {
|
|
cygx_db, _ := orm.GetDB("hz_cygx")
|
|
cygx_db, _ := orm.GetDB("hz_cygx")
|
|
cygx_db.SetConnMaxLifetime(10 * time.Minute)
|
|
cygx_db.SetConnMaxLifetime(10 * time.Minute)
|
|
|
|
|
|
|
|
+ if utils.MYSQL_URL_ETA != `` {
|
|
|
|
+ _ = orm.RegisterDataBase("eta", "mysql", utils.MYSQL_URL_ETA)
|
|
|
|
+ orm.SetMaxIdleConns("eta", 50)
|
|
|
|
+ orm.SetMaxOpenConns("eta", 100)
|
|
|
|
+
|
|
|
|
+ eta_db, _ := orm.GetDB("eta")
|
|
|
|
+ eta_db.SetConnMaxLifetime(10 * time.Minute)
|
|
|
|
+ }
|
|
|
|
+
|
|
//注册对象
|
|
//注册对象
|
|
orm.RegisterModel(
|
|
orm.RegisterModel(
|
|
new(open_api_user.OpenApiUser), //开放API用户表
|
|
new(open_api_user.OpenApiUser), //开放API用户表
|
|
@@ -55,6 +65,7 @@ func init() {
|
|
new(cygx_activity.CygxYidongActivityExamineStatus), //易董审核记录日志
|
|
new(cygx_activity.CygxYidongActivityExamineStatus), //易董审核记录日志
|
|
new(cygx_activity.CygxMySchedule), //易董审核通过之后添加我的日程
|
|
new(cygx_activity.CygxMySchedule), //易董审核通过之后添加我的日程
|
|
new(cygx_three_api_log.CygxThreeApiLog), //易董审核通过之后添加我的日程
|
|
new(cygx_three_api_log.CygxThreeApiLog), //易董审核通过之后添加我的日程
|
|
|
|
+ new(business_conf.BusinessConf), //商家配置
|
|
)
|
|
)
|
|
orm.Debug = true
|
|
orm.Debug = true
|
|
orm.DebugLog = orm.NewLog(utils.Binlog)
|
|
orm.DebugLog = orm.NewLog(utils.Binlog)
|
|
@@ -66,6 +77,8 @@ func init() {
|
|
initCompany()
|
|
initCompany()
|
|
|
|
|
|
initEnglishReport()
|
|
initEnglishReport()
|
|
|
|
+
|
|
|
|
+ AfterInitTable()
|
|
}
|
|
}
|
|
|
|
|
|
// initYb 研报活动相关
|
|
// initYb 研报活动相关
|
|
@@ -97,3 +110,8 @@ func initEnglishReport() {
|
|
new(tables.EnglishReport), //英文研报表
|
|
new(tables.EnglishReport), //英文研报表
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func AfterInitTable() {
|
|
|
|
+ // 初始化商家基本配置
|
|
|
|
+ business_conf.InitBusinessConf()
|
|
|
|
+}
|