db2.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. package models
  2. import (
  3. "eta_gn/eta_api/models/ai_summary"
  4. "eta_gn/eta_api/models/aimod"
  5. "eta_gn/eta_api/models/data_manage"
  6. "eta_gn/eta_api/models/data_manage/chart_theme"
  7. "eta_gn/eta_api/models/data_manage/cross_variety"
  8. "eta_gn/eta_api/models/data_manage/data_manage_permission"
  9. "eta_gn/eta_api/models/data_manage/edb_refresh"
  10. "eta_gn/eta_api/models/data_manage/excel"
  11. future_good2 "eta_gn/eta_api/models/data_manage/future_good"
  12. "eta_gn/eta_api/models/data_manage/supply_analysis"
  13. "eta_gn/eta_api/models/fe_calendar"
  14. "eta_gn/eta_api/models/report"
  15. "eta_gn/eta_api/models/report_approve"
  16. "eta_gn/eta_api/models/sandbox"
  17. "eta_gn/eta_api/models/semantic_analysis"
  18. "eta_gn/eta_api/models/smart_report"
  19. "eta_gn/eta_api/models/speech_recognition"
  20. "eta_gn/eta_api/models/system"
  21. _ "github.com/go-sql-driver/mysql"
  22. "github.com/beego/beego/v2/client/orm"
  23. )
  24. func init() {
  25. orm.RegisterModel(
  26. new(Classify),
  27. new(Resource),
  28. new(PptV2),
  29. new(PptV2PublishRecord),
  30. new(PptV2SaveLog),
  31. new(PptV2Group),
  32. new(PptV2GroupMapping),
  33. new(PptV2Grant), //ppt授权操作表
  34. new(ResearchVarietyTagRelation), // 研究员标签关系表
  35. new(ReportPptImg), //Ppt转报告的图片记录表
  36. )
  37. initSystem()
  38. initReport()
  39. initSandbox()
  40. initShEdbData()
  41. initEdbData()
  42. initChart()
  43. initFutureGood()
  44. initSemanticAnalysis()
  45. initSupplyAnalysis()
  46. initMultipleGraphConfig()
  47. initBusinessConf()
  48. initChartFramework()
  49. initOutLink()
  50. initSmartReport()
  51. initExcel()
  52. initCrossVariety()
  53. initAi()
  54. initReportApprove()
  55. initChartTheme()
  56. initEdbRefresh()
  57. initSpeechRecognition()
  58. initDataMangePerMission()
  59. initFeCalendar()
  60. initFactorEdbSeries()
  61. }
  62. func initSystem() {
  63. orm.RegisterModel(
  64. new(system.SysUserLoginRecord),
  65. new(system.SysSession),
  66. new(system.SysDepartment),
  67. new(system.SysGroup),
  68. new(system.SysRoleMenu),
  69. new(system.Admin),
  70. new(system.SysRole),
  71. new(system.SysMenuButton),
  72. new(system.SysRoleButton),
  73. new(system.SysRoleAdmin), //管理员账号和角色映射表
  74. new(system.AdminConfig), //系统用户配置表
  75. new(system.AdminOperateRecord),
  76. new(system.AdminVerifyCodeRecord), // 用户短信邮箱验证码记录表
  77. )
  78. }
  79. func initReport() {
  80. orm.RegisterModel(
  81. new(Report),
  82. new(ReportViewRecord),
  83. new(ChartPermissionSearchKeyWordMapping), //报告分类权限表
  84. new(ReportChapter), // 报告章节表
  85. new(ReportChapterTicker), // 晨报章节ticker
  86. new(ReportChapterTypePermission), // 晨周报章节类型权限表
  87. new(ChartPermission), // 权限表
  88. new(YbPcSuncode),
  89. new(YbSuncodePars),
  90. new(ReportAuthor), //报告作者
  91. new(ClassifyMenu), // 报告分类-子目录表
  92. new(ClassifyMenuRelation), // 报告分类-子目录关联表
  93. new(ChartPermissionChapterMapping), // 权限mapping表
  94. new(ReportChapterType), // 报告章节类型表
  95. new(ReportStateRecord), // 研报状态修改记录表
  96. new(report.ReportGrant), // 报告授权用户表
  97. new(report.ReportChapterGrant), // 报告章节授权用户表
  98. new(report.ReportChapterPermissionMapping), // 报告章节的权限关系表
  99. )
  100. }
  101. func initSandbox() {
  102. orm.RegisterModel(
  103. new(sandbox.Sandbox), //沙盘主表
  104. new(sandbox.SandboxVersion), //沙盘版本表
  105. new(sandbox.SandboxDraft), //沙盘草稿表
  106. new(sandbox.SandboxClassify), //沙盘分类表
  107. )
  108. }
  109. func initShEdbData() {
  110. orm.RegisterModel(
  111. new(Edbdata),
  112. new(EdbdataDeleteRecord),
  113. new(EdbdataImportFail),
  114. new(EdbImportFail), //指标导入失败数据表
  115. new(Edbinfo), //edb库的edbinfo表
  116. new(data_manage.ExcelStyle), //在线excel样式表
  117. new(data_manage.ExcelEdbdataMapping), //excel样式和指标映射表
  118. new(EdbinfoOpRecord), // 手工数据的操作日志
  119. )
  120. }
  121. func initEdbData() {
  122. orm.RegisterModel(
  123. new(data_manage.EdbClassify),
  124. new(data_manage.EdbInfo), //hz_data库的edb_info表
  125. new(data_manage.ManualUserClassify),
  126. new(data_manage.EdbdataClassify),
  127. new(data_manage.ManualUser),
  128. new(data_manage.EdbInfoCalculate),
  129. new(data_manage.SearchKeyword),
  130. new(data_manage.EdbInfoLog),
  131. new(data_manage.EdbInfoRecord),
  132. new(data_manage.EdbInfoCalculateMapping),
  133. new(data_manage.PredictEdbConf), //预测指标配置
  134. new(data_manage.PredictEdbRuleData), //预测指标,动态规则的计算数据
  135. new(data_manage.TradePositionDalianTop),
  136. new(data_manage.TradePositionZhengzhouTop),
  137. new(data_manage.TradePositionCffexTop),
  138. new(data_manage.TradePositionShanghaiTop),
  139. new(data_manage.TradePositionIneTop),
  140. new(data_manage.EdbDataInsertConfig), // 指标数据插入配置表
  141. new(data_manage.EdbInfoNoPermissionAdmin), //指标不可见用户配置表
  142. new(data_manage.EdbTerminal), //指标终端
  143. new(data_manage.BaseFromEdbMapping),
  144. new(data_manage.EdbInfoRelation), //指标关系表
  145. )
  146. }
  147. func initChart() {
  148. orm.RegisterModel(
  149. new(data_manage.ChartClassify),
  150. new(data_manage.ChartInfo),
  151. new(data_manage.ChartEdbMapping),
  152. new(data_manage.MyChartClassify),
  153. new(data_manage.MyChart),
  154. new(data_manage.MyChartLog),
  155. new(data_manage.MyChartClassifyMapping),
  156. new(data_manage.ChartInfoLog),
  157. new(data_manage.ChartInfoCorrelation),
  158. new(data_manage.ChartSeries),
  159. new(data_manage.ChartSeriesEdbMapping),
  160. )
  161. }
  162. func initFutureGood() {
  163. orm.RegisterModel(
  164. new(future_good2.FutureGoodEdbInfo), //期货指标表
  165. new(future_good2.FutureGoodEdbData), //期货指标数据表
  166. new(future_good2.ChartInfoFutureGoodProfit), //期货利润图的扩展表
  167. )
  168. }
  169. func initSemanticAnalysis() {
  170. orm.RegisterModel(
  171. new(semantic_analysis.SaLabel), // 语义分析-标签表
  172. new(semantic_analysis.SaDocClassify), // 语义分析-文档分类表
  173. new(semantic_analysis.SaDoc), // 语义分析-文档表
  174. new(semantic_analysis.SaDocSection), // 语义分析-文档段落表
  175. new(semantic_analysis.SaCompareClassify), // 语义分析-比对分类表
  176. new(semantic_analysis.SaCompare), // 语义分析-比对表
  177. new(semantic_analysis.SaCompareDoc), // 语义分析-比对关联文档表
  178. new(semantic_analysis.SaCompareLabel), // 语义分析-比对段落表
  179. new(semantic_analysis.SaCompareSearchKeyword), // 语义分析-比对搜索关键词
  180. )
  181. }
  182. func initSupplyAnalysis() {
  183. orm.RegisterModel(
  184. new(supply_analysis.Variety),
  185. new(supply_analysis.VarietyAdminPermission),
  186. new(supply_analysis.VarietyEdbInfo),
  187. new(supply_analysis.VarietyPlant),
  188. )
  189. }
  190. func initMultipleGraphConfig() {
  191. orm.RegisterModel(
  192. new(data_manage.MultipleGraphConfig), //多图配置表
  193. new(data_manage.MultipleGraphConfigChartMapping), //图表与多图配置的关系表
  194. new(data_manage.MultipleGraphConfigEdbMapping), //指标与多图配置的关系表
  195. )
  196. }
  197. func initBusinessConf() {
  198. orm.RegisterModel(
  199. new(BusinessConf), // 商家配置表
  200. new(BusinessConfOperationRecord), // 商家配置操作记录表
  201. )
  202. }
  203. func initOutLink() {
  204. orm.RegisterModel(
  205. new(OutLink)) // 外部链接表
  206. }
  207. func initChartFramework() {
  208. orm.RegisterModel(
  209. new(data_manage.ChartFramework), // 图库框架主表
  210. new(data_manage.ChartFrameworkNode), // 图库框架节点表
  211. )
  212. }
  213. func initExcel() {
  214. orm.RegisterModel(
  215. new(excel.ExcelClassify), //ETA excel表格分类
  216. new(excel.ExcelInfo), //ETA excel表格
  217. new(excel.ExcelDraft), //ETA excel表格草稿
  218. new(excel.ExcelSheet), //ETA excel sheet
  219. new(excel.ExcelSheetData), //ETA excel sheet data
  220. new(excel.ExcelEdbMapping), //ETA excel 与 指标 的关系表
  221. new(excel.ExcelWorker), // 平衡表协作人表格
  222. new(excel.ExcelChartEdb), // 平衡表做图指标
  223. new(excel.ExcelChartData), // 平衡表作图数据
  224. new(excel.ExcelInfoRuleMapping), //表格的管理规则
  225. )
  226. }
  227. func initSmartReport() {
  228. orm.RegisterModel(
  229. new(smart_report.SmartReportResource), // 智能研报-资源表
  230. )
  231. }
  232. func initCrossVariety() {
  233. orm.RegisterModel(
  234. new(cross_variety.ChartVariety), // 品种表
  235. new(cross_variety.ChartTag), // 标签表
  236. new(cross_variety.ChartTagVariety), // 标签、品种、指标关系表
  237. new(cross_variety.ChartVarietyMapping), // 图表与品种的关系表
  238. new(cross_variety.ChartInfoCrossVariety), // 跨品种分析配置表
  239. )
  240. }
  241. func initAi() {
  242. orm.RegisterModel(
  243. new(aimod.AiChatTopic),
  244. new(aimod.AiChat),
  245. new(aimod.FileUploadRecord),
  246. new(ai_summary.AiSummaryClassify),
  247. new(ai_summary.AiSummary),
  248. new(ai_summary.AiPrompt),
  249. )
  250. }
  251. func initReportApprove() {
  252. orm.RegisterModel(
  253. new(report_approve.ReportApprove), // 审批表
  254. new(report_approve.ReportApproveFlow), // 审批流表
  255. new(report_approve.ReportApproveNode), // 审批节点表
  256. new(report_approve.ReportApproveRecord), // 审批记录表
  257. new(report_approve.ReportApproveMessage), // 审批消息表
  258. )
  259. }
  260. func initChartTheme() {
  261. orm.RegisterModel(
  262. new(chart_theme.ChartTheme), // 图表主题
  263. new(chart_theme.ChartThemeType), // 图表主题类型
  264. new(chart_theme.ChartThemeDefaultData), //默认数据
  265. )
  266. }
  267. func initEdbRefresh() {
  268. orm.RegisterModel(
  269. new(edb_refresh.EdbRefreshSource), // 刷新的数据源表
  270. new(edb_refresh.EdbRefreshDefaultConfig), // 指标的默认刷新时间配置表
  271. new(edb_refresh.EdbRefreshConfig), // 指标的刷新时间配置表
  272. new(edb_refresh.EdbRefreshMapping), // 指标刷新时间配置关系表
  273. )
  274. }
  275. func initSpeechRecognition() {
  276. orm.RegisterModel(
  277. new(speech_recognition.SpeechRecognition), // 语音识别表
  278. new(speech_recognition.SpeechRecognitionApiLog), // 语音识别-API请求日志
  279. new(speech_recognition.SpeechRecognitionContent), // 语音识别-转换内容表
  280. new(speech_recognition.SpeechRecognitionMenu), // 语音识别-目录表
  281. new(speech_recognition.SpeechRecognitionTag), // 语音识别-标签表
  282. new(speech_recognition.SpeechRecognitionTagMenu), // 语音识别-标签目录表
  283. new(speech_recognition.SpeechRecognitionTagMapping), // 语音识别-标签关联表
  284. )
  285. }
  286. func initDataMangePerMission() {
  287. orm.RegisterModel(
  288. new(data_manage_permission.EdbInfoPermission), // 指标权限表
  289. new(data_manage_permission.EdbClassifyPermission), // 指标分类权限表
  290. new(data_manage_permission.ChartInfoPermission), // 图表权限表
  291. new(data_manage_permission.ChartClassifyPermission), // 图表分类权限表
  292. new(data_manage_permission.ExcelInfoPermission), // ETA表格权限表
  293. new(data_manage_permission.ExcelClassifyPermission), // ETA表格分类权限表
  294. new(data_manage_permission.DataPermissionMessage), // 数据权限变更消息表
  295. new(data_manage_permission.DataPermissionMoveRecord), // 数据资产转移记录表
  296. new(data_manage_permission.EdbInfoPermissionNoAuthRecord), // 指标资产数据未授权分类记录表
  297. new(data_manage_permission.ChartInfoPermissionNoAuthRecord), // 图表资产数据未授权分类记录表
  298. new(data_manage_permission.ExcelInfoPermissionNoAuthRecord), // ETA表格资产数据未授权分类记录表
  299. new(data_manage_permission.EdbInfoClassifyPermissionNoAuthRecord), // 指标资产分类数据未授权分类记录表
  300. new(data_manage_permission.ChartInfoClassifyPermissionNoAuthRecord), // 图表资产分类数据未授权分类记录表
  301. new(data_manage_permission.ExcelInfoClassifyPermissionNoAuthRecord), // ETA表格资产分类数据未授权分类记录表
  302. new(data_manage_permission.DataPermissionClassifyNoAuthRecord), // 资产分类数据权限未授权记录表
  303. new(data_manage_permission.DataPermissionNoAuthRecord), // 资产数据权限设置记录表
  304. )
  305. }
  306. func initFeCalendar() {
  307. orm.RegisterModel(
  308. new(fe_calendar.FeCalendarMatter), // 事项表
  309. )
  310. }
  311. func initFactorEdbSeries() {
  312. orm.RegisterModel(
  313. new(data_manage.FactorEdbSeries), // 因子指标系列
  314. new(data_manage.FactorEdbSeriesChartMapping), // 因子指标系列-图表关联
  315. new(data_manage.FactorEdbSeriesMapping), // 因子指标系列-指标计算数据
  316. new(data_manage.FactorEdbSeriesCalculateData), // 因子指标系列-指标关联
  317. new(data_manage.FactorEdbSeriesCalculateDataQjjs), // 因子指标系列-区间计算数据
  318. )
  319. }