123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649 |
- package models
- import (
- "eta/eta_api/models/ai_summary"
- "eta/eta_api/models/aimod"
- "eta/eta_api/models/company"
- "eta/eta_api/models/data_manage"
- "eta/eta_api/models/data_manage/chart_theme"
- "eta/eta_api/models/data_manage/cross_variety"
- "eta/eta_api/models/data_manage/data_manage_permission"
- "eta/eta_api/models/data_manage/edb_refresh"
- "eta/eta_api/models/data_manage/excel"
- future_good2 "eta/eta_api/models/data_manage/future_good"
- "eta/eta_api/models/data_manage/supply_analysis"
- "eta/eta_api/models/data_stat"
- "eta/eta_api/models/eta_trial"
- "eta/eta_api/models/fe_calendar"
- "eta/eta_api/models/ppt_english"
- "eta/eta_api/models/report"
- "eta/eta_api/models/report_approve"
- "eta/eta_api/models/sandbox"
- "eta/eta_api/models/semantic_analysis"
- "eta/eta_api/models/smart_report"
- "eta/eta_api/models/speech_recognition"
- "eta/eta_api/models/system"
- "eta/eta_api/models/yb"
- "eta/eta_api/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("rddp", "mysql", utils.MYSQL_URL_RDDP)
- orm.SetMaxIdleConns("rddp", 50)
- orm.SetMaxOpenConns("rddp", 100)
- report_db, _ := orm.GetDB("rddp")
- report_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("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("gl", "mysql", utils.MYSQL_URL_GL)
- orm.SetMaxIdleConns("gl", 50)
- orm.SetMaxOpenConns("gl", 100)
- gl, _ := orm.GetDB("gl")
- gl.SetConnMaxLifetime(10 * time.Minute)
-
- if utils.MYSQL_WEEKLY_URL != `` && (utils.BusinessCode == utils.BusinessCodeRelease || utils.BusinessCode == utils.BusinessCodeSandbox || utils.BusinessCode == utils.BusinessCodeDebug) {
- _ = orm.RegisterDataBase("weekly", "mysql", utils.MYSQL_WEEKLY_URL)
- orm.SetMaxIdleConns("weekly", 50)
- orm.SetMaxOpenConns("weekly", 100)
- weeklyDb, _ := orm.GetDB("weekly")
- weeklyDb.SetConnMaxLifetime(10 * time.Minute)
- }
- if utils.MYSQL_AI_URL != "" {
- _ = orm.RegisterDataBase("ai", "mysql", utils.MYSQL_AI_URL)
- orm.SetMaxIdleConns("ai", 50)
- orm.SetMaxOpenConns("ai", 100)
- weeklyDb, _ := orm.GetDB("ai")
- weeklyDb.SetConnMaxLifetime(10 * time.Minute)
- }
- orm.Debug = true
- orm.DebugLog = orm.NewLog(utils.Binlog)
-
- orm.RegisterModel(
- new(Classify),
- new(Resource),
- new(PptV2),
- new(PptV2PublishRecord),
- new(PptV2SaveLog),
- new(PptV2Group),
- new(PptV2GroupMapping),
- new(PptV2Grant),
- new(VarietyClassify),
- new(VarietyTag),
- new(ResearchVarietyTagRelation),
- new(ReportPptImg),
- )
-
- initSystem()
-
- initCompany()
-
- initWxUser()
-
- initReport()
-
- initYb()
-
- initSandbox()
-
- initShEdbData()
-
- initEdbData()
-
- initChart()
-
- initEnglishReport()
-
- initPptEnglish()
-
- initFutureGood()
-
- initCloudDisk()
-
- initSemanticAnalysis()
-
- initSupplyAnalysis()
-
- initMultipleGraphConfig()
-
- initBusinessConf()
-
- initChartFramework()
-
- initOutLink()
-
- initSmartReport()
-
- if utils.BusinessCode == utils.BusinessCodeSandbox {
- initEtaTrial()
- }
-
- initDataStat()
-
- initExcel()
-
- initCrossVariety()
-
- initAi()
-
- initReportApprove()
-
- initChartTheme()
-
- initEdbRefresh()
-
- initSpeechRecognition()
-
- initDataMangePerMission()
-
- initFeCalendar()
-
- initFactorEdbSeries()
-
- afterInitTable()
- }
- func initSystem() {
- orm.RegisterModel(
- new(system.SysUserLoginRecord),
- new(system.SysSession),
- new(system.SysDepartment),
- new(system.SysGroup),
- new(system.SysRoleMenu),
- new(system.Admin),
- new(system.SysRole),
- new(system.SysMenuButton),
- new(system.SysRoleButton),
- new(system.ResearchGroup),
- new(system.ResearchGroupRelation),
- new(system.SysRoleAdmin),
- new(system.AdminConfig),
- new(system.AdminOperateRecord),
- new(system.AdminVerifyCodeRecord),
- )
- }
- func initCompany() {
- orm.RegisterModel(
- new(company.Company),
- )
- }
- func initWxUser() {
- orm.RegisterModel(
- new(WxUser),
- new(UserSellerRelation),
- )
- }
- func initReport() {
- orm.RegisterModel(
- new(Report),
- new(ReportViewRecord),
- new(ChartPermissionSearchKeyWordMapping),
- new(ReportChapter),
- new(ReportChapterTicker),
- new(ReportChapterTypePermission),
- new(ChartPermission),
- new(YbPcSuncode),
- new(YbSuncodePars),
- new(ReportAuthor),
- new(ClassifyMenu),
- new(ClassifyMenuRelation),
- new(ChartPermissionChapterMapping),
- new(ReportChapterType),
- new(ReportStateRecord),
- new(report.ReportGrant),
- new(report.ReportChapterGrant),
- new(report.ReportChapterPermissionMapping),
- )
- }
- func initYb() {
- orm.RegisterModel(
- new(yb.PriceDriven),
- new(yb.PriceDrivenSaveLog),
- new(yb.PriceDrivenTag),
- new(yb.CommunityQuestionProcess),
- )
- }
- func initSandbox() {
-
- orm.RegisterModel(
- new(sandbox.Sandbox),
- new(sandbox.SandboxVersion),
- new(sandbox.SandboxDraft),
- new(sandbox.SandboxClassify),
- )
- }
- func initShEdbData() {
- orm.RegisterModel(
- new(Edbdata),
- new(EdbdataDeleteRecord),
- new(EdbdataImportFail),
- new(EdbImportFail),
- new(Edbinfo),
- new(data_manage.ExcelStyle),
- new(data_manage.ExcelEdbdataMapping),
- new(EdbinfoOpRecord),
- )
- }
- func initEdbData() {
- 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.ManualUserClassify),
- new(data_manage.EdbdataClassify),
- new(data_manage.ManualUser),
- new(data_manage.EdbInfoCalculate),
- new(data_manage.SearchKeyword),
- new(data_manage.BaseFromSmm),
- new(data_manage.BaseFromSmmIndex),
- new(data_manage.BaseFromSmmData),
- new(data_manage.BaseFromSmmClassify),
- new(data_manage.EdbInfoLog),
- new(data_manage.EdbInfoRecord),
- new(data_manage.EdbInfoCalculateMapping),
- new(data_manage.PredictEdbConf),
- new(data_manage.BaseFromMysteelChemicalClassify),
- new(data_manage.BaseFromMysteelChemicalIndex),
- new(data_manage.BaseFromEiaSteoClassify),
- new(data_manage.BaseFromEiaSteoIndex),
- new(data_manage.PredictEdbRuleData),
- new(data_manage.ComTradeCountry),
- new(data_manage.ComTradeData),
- new(data_manage.BaseFromSci),
- new(data_manage.BaseFromSciIndex),
- new(data_manage.BaseFromSciData),
- new(data_manage.BaseFromSciClassify),
- new(data_manage.TradePositionDalianTop),
- new(data_manage.TradePositionZhengzhouTop),
- new(data_manage.TradePositionCffexTop),
- new(data_manage.TradePositionShanghaiTop),
- new(data_manage.TradePositionIneTop),
- new(data_manage.BaseFromBaiinfo),
- new(data_manage.BaseFromBaiinfoIndex),
- new(data_manage.BaseFromBaiinfoData),
- new(data_manage.BaseFromBaiinfoClassify),
- new(data_manage.EdbDataInsertConfig),
- new(data_manage.EdbInfoNoPermissionAdmin),
- new(data_manage.EdbTerminal),
- new(data_manage.BaseFromThsHfIndex),
- new(data_manage.BaseFromThsHfData),
- new(data_manage.BaseFromThsHfClassify),
- new(data_manage.BaseFromEdbMapping),
- new(data_manage.EdbInfoRelation),
- new(data_manage.BaseFromSciHqClassify),
- new(data_manage.BaseFromSciHqIndex),
- new(data_manage.BaseFromSciHqData),
- )
- }
- func initChart() {
- orm.RegisterModel(
- new(data_manage.ChartClassify),
- new(data_manage.ChartInfo),
- new(data_manage.ChartEdbMapping),
- new(data_manage.MyChartClassify),
- new(data_manage.MyChart),
- new(data_manage.MyChartLog),
- new(data_manage.MyChartClassifyMapping),
- new(data_manage.ChartInfoLog),
- new(data_manage.ChartInfoCorrelation),
- new(data_manage.ChartSeries),
- new(data_manage.ChartSeriesEdbMapping),
- )
- }
- func initEnglishReport() {
- orm.RegisterModel(
- new(EnglishReport),
- new(EnglishPolicyReport),
- new(EnglishReportEmail),
- new(EnglishReportEmailPV),
- new(EnglishReportEmailLog),
- new(EnglishClassify),
- new(EnglishCompany),
- new(EnglishCompanyLog),
- new(EnglishReportEmailOpLog),
- new(EnglishCompanyTodo),
- new(EnglishCompanyTodoPublic),
- new(EnglishVideoCover),
- new(EnglishVideo),
- new(EnPermission),
- new(EnCompanyPermission),
- new(EnClassifyPermission),
- )
- }
- func initPptEnglish() {
- orm.RegisterModel(
- new(ppt_english.PptEnglish),
- new(ppt_english.PptEnglishPublishRecord),
- new(ppt_english.PptEnglishSaveLog),
- new(ppt_english.PptEnglishGroup),
- new(ppt_english.PptEnglishGroupMapping),
- new(ppt_english.PptEnglishGrant),
- new(ppt_english.ReportPptEnglishImg),
- )
- }
- func initFutureGood() {
-
- orm.RegisterModel(
- new(future_good2.FutureGoodEdbInfo),
- new(future_good2.FutureGoodEdbData),
-
- new(future_good2.ChartInfoFutureGoodProfit),
- )
- }
- func initCloudDisk() {
-
- orm.RegisterModel(
- new(CloudDiskMenu),
- new(CloudDiskResource),
- )
- }
- func initSemanticAnalysis() {
- orm.RegisterModel(
- new(semantic_analysis.SaLabel),
- new(semantic_analysis.SaDocClassify),
- new(semantic_analysis.SaDoc),
- new(semantic_analysis.SaDocSection),
- new(semantic_analysis.SaCompareClassify),
- new(semantic_analysis.SaCompare),
- new(semantic_analysis.SaCompareDoc),
- new(semantic_analysis.SaCompareLabel),
- new(semantic_analysis.SaCompareSearchKeyword),
- )
- }
- func initSupplyAnalysis() {
- orm.RegisterModel(
- new(supply_analysis.Variety),
- new(supply_analysis.VarietyAdminPermission),
- new(supply_analysis.VarietyEdbInfo),
- new(supply_analysis.VarietyPlant),
- )
- }
- func initMultipleGraphConfig() {
-
- orm.RegisterModel(
- new(data_manage.MultipleGraphConfig),
- new(data_manage.MultipleGraphConfigChartMapping),
- new(data_manage.MultipleGraphConfigEdbMapping),
- )
- }
- func initBusinessConf() {
- orm.RegisterModel(
- new(BusinessConf),
- new(BusinessConfOperationRecord),
- )
- }
- func initOutLink() {
- orm.RegisterModel(
- new(OutLink))
- }
- func initEtaTrial() {
- orm.RegisterModel(
- new(eta_trial.QuestionnaireFillRecord),
- )
- }
- func initDataStat() {
- orm.RegisterModel(
- new(data_stat.EdbInfoDeleteLog),
- new(data_stat.EdbInfoUpdateStat),
- new(data_stat.EdbInfoUpdateLog),
- new(data_stat.EdbSourceStat),
- )
- }
- func initChartFramework() {
- orm.RegisterModel(
- new(data_manage.ChartFramework),
- new(data_manage.ChartFrameworkNode),
- )
- }
- func initExcel() {
- orm.RegisterModel(
- new(excel.ExcelClassify),
- new(excel.ExcelInfo),
- new(excel.ExcelDraft),
- new(excel.ExcelSheet),
- new(excel.ExcelSheetData),
- new(excel.ExcelEdbMapping),
- new(excel.ExcelWorker),
- new(excel.ExcelChartEdb),
- new(excel.ExcelChartData),
- new(excel.ExcelInfoRuleMapping),
- )
- }
- func initSmartReport() {
- orm.RegisterModel(
- new(smart_report.SmartReport),
- new(smart_report.SmartReportSaveLog),
- new(smart_report.SmartReportResource),
- )
- }
- func initCrossVariety() {
- orm.RegisterModel(
- new(cross_variety.ChartVariety),
- new(cross_variety.ChartTag),
- new(cross_variety.ChartTagVariety),
- new(cross_variety.ChartVarietyMapping),
- new(cross_variety.ChartInfoCrossVariety),
- )
- }
- func initAi() {
- orm.RegisterModel(
- new(aimod.AiChatTopic),
- new(aimod.AiChat),
- new(aimod.FileUploadRecord),
- new(ai_summary.AiSummaryClassify),
- new(ai_summary.AiSummary),
- new(ai_summary.AiPrompt),
- )
- }
- func initReportApprove() {
- orm.RegisterModel(
- new(report_approve.ReportApprove),
- new(report_approve.ReportApproveFlow),
- new(report_approve.ReportApproveNode),
- new(report_approve.ReportApproveRecord),
- new(report_approve.ReportApproveMessage),
- )
- }
- func initChartTheme() {
- orm.RegisterModel(
- new(chart_theme.ChartTheme),
- new(chart_theme.ChartThemeType),
- new(chart_theme.ChartThemeDefaultData),
- )
- }
- func initEdbRefresh() {
- orm.RegisterModel(
- new(edb_refresh.EdbRefreshSource),
- new(edb_refresh.EdbRefreshDefaultConfig),
- new(edb_refresh.EdbRefreshConfig),
- new(edb_refresh.EdbRefreshMapping),
- )
- }
- func initSpeechRecognition() {
- orm.RegisterModel(
- new(speech_recognition.SpeechRecognition),
- new(speech_recognition.SpeechRecognitionApiLog),
- new(speech_recognition.SpeechRecognitionContent),
- new(speech_recognition.SpeechRecognitionMenu),
- new(speech_recognition.SpeechRecognitionTag),
- new(speech_recognition.SpeechRecognitionTagMenu),
- new(speech_recognition.SpeechRecognitionTagMapping),
- )
- }
- func initDataMangePerMission() {
- orm.RegisterModel(
- new(data_manage_permission.EdbInfoPermission),
- new(data_manage_permission.EdbClassifyPermission),
- new(data_manage_permission.ChartInfoPermission),
- new(data_manage_permission.ChartClassifyPermission),
- new(data_manage_permission.ExcelInfoPermission),
- new(data_manage_permission.ExcelClassifyPermission),
- new(data_manage_permission.DataPermissionMessage),
- new(data_manage_permission.DataPermissionMoveRecord),
- new(data_manage_permission.EdbInfoPermissionNoAuthRecord),
- new(data_manage_permission.ChartInfoPermissionNoAuthRecord),
- new(data_manage_permission.ExcelInfoPermissionNoAuthRecord),
- new(data_manage_permission.EdbInfoClassifyPermissionNoAuthRecord),
- new(data_manage_permission.ChartInfoClassifyPermissionNoAuthRecord),
- new(data_manage_permission.ExcelInfoClassifyPermissionNoAuthRecord),
- new(data_manage_permission.DataPermissionClassifyNoAuthRecord),
- new(data_manage_permission.DataPermissionNoAuthRecord),
- )
- }
- func initFeCalendar() {
- orm.RegisterModel(
- new(fe_calendar.FeCalendarMatter),
- )
- }
- func initFactorEdbSeries() {
- orm.RegisterModel(
- new(data_manage.FactorEdbSeries),
- new(data_manage.FactorEdbSeriesChartMapping),
- new(data_manage.FactorEdbSeriesMapping),
- new(data_manage.FactorEdbSeriesCalculateData),
- new(data_manage.FactorEdbSeriesCalculateDataQjjs),
- )
- }
- func afterInitTable() {
-
- data_manage.InitEdbSourceVar()
-
- InitUseMongoConf()
- }
|