You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

user_business_struct.go 25 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. package models
  2. import "code.gitea.io/gitea/modules/timeutil"
  3. type UserSummaryCurrentYear struct {
  4. ID int64 `xorm:"pk"`
  5. Email string `xorm:"NOT NULL"`
  6. //user
  7. Name string `xorm:"NOT NULL"`
  8. Phone string `xorm:"NULL"`
  9. //user
  10. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  11. DateCount int `xorm:"NOT NULL DEFAULT 0"`
  12. MostActiveDay string `xorm:" NULL "` //08.05
  13. RepoInfo string `xorm:"varchar(1000)"` //创建了XX 个项目,公开项目XX 个,私有项目XX 个累计被下载XXX 次,其中《XXXXXXX 》项目,获得了最高XXX 次下载
  14. DataSetInfo string `xorm:"varchar(500)"` //创建了XX 个数据集,上传了XX 个数据集文件,累计被下载XX 次,被收藏XX 次
  15. CodeInfo string `xorm:"varchar(500)"` //代码提交次数,提交总代码行数,最晚的提交时间
  16. CloudBrainInfo string `xorm:"varchar(1000)"` //,创建了XX 个云脑任务,调试任务XX 个,训练任务XX 个,推理任务XX 个,累计运行了XXXX 卡时,累计节省xxxxx 元
  17. //这些免费的算力资源分别有,XX% 来自鹏城云脑1,XX% 来自鹏城云脑2,XX% 来自智算网络
  18. PlayARoll string `xorm:"varchar(500)"` //你参加了XX 次“我为开源打榜狂”活动,累计上榜XX 次,总共获得了社区XXX 元的激励
  19. Label string `xorm:"varchar(500)"`
  20. }
  21. type UserBusinessAnalysisCurrentYear struct {
  22. ID int64 `xorm:"pk"`
  23. CountDate int64 `xorm:"pk"`
  24. //action :ActionMergePullRequest // 11
  25. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  26. //action :ActionCommitRepo
  27. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  28. //issue // 10
  29. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  30. //comment table current date
  31. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  32. //watch table current date
  33. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  34. //star table current date
  35. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  36. //follow table
  37. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  38. // user table
  39. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  40. //
  41. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  42. //attachement table
  43. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  44. //0
  45. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  46. //issue, issueassignees
  47. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  48. //baike
  49. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  50. //user
  51. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  52. //repo
  53. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  54. //login count, from elk
  55. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  56. //openi index
  57. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  58. //user
  59. Email string `xorm:"NOT NULL"`
  60. //user
  61. Name string `xorm:"NOT NULL"`
  62. DataDate string `xorm:"NULL"`
  63. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  64. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  65. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  66. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  67. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  68. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  69. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  70. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  71. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  72. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  73. UserIndexPrimitive float64 `xorm:"NOT NULL DEFAULT 0"`
  74. UserLocation string `xorm:"NULL"`
  75. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  76. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  77. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  78. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  79. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  80. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  81. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  82. Phone string `xorm:"NULL"`
  83. InvitationUserNum int `xorm:"NOT NULL DEFAULT 0"`
  84. }
  85. type UserBusinessAnalysisLast30Day struct {
  86. ID int64 `xorm:"pk"`
  87. CountDate int64 `xorm:"pk"`
  88. //action :ActionMergePullRequest // 11
  89. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  90. //action :ActionCommitRepo
  91. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  92. //issue // 10
  93. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  94. //comment table current date
  95. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  96. //watch table current date
  97. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  98. //star table current date
  99. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  100. //follow table
  101. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  102. // user table
  103. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  104. //
  105. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  106. //attachement table
  107. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  108. //0
  109. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  110. //issue, issueassignees
  111. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  112. //baike
  113. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  114. //user
  115. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  116. //repo
  117. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  118. //login count, from elk
  119. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  120. //openi index
  121. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  122. //user
  123. Email string `xorm:"NOT NULL"`
  124. //user
  125. Name string `xorm:"NOT NULL"`
  126. DataDate string `xorm:"NULL"`
  127. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  128. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  129. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  130. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  131. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  132. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  133. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  134. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  135. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  136. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  137. UserIndexPrimitive float64 `xorm:"NOT NULL DEFAULT 0"`
  138. UserLocation string `xorm:"NULL"`
  139. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  140. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  141. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  142. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  143. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  144. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  145. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  146. Phone string `xorm:"NULL"`
  147. InvitationUserNum int `xorm:"NOT NULL DEFAULT 0"`
  148. }
  149. type UserBusinessAnalysisLastMonth struct {
  150. ID int64 `xorm:"pk"`
  151. CountDate int64 `xorm:"pk"`
  152. //action :ActionMergePullRequest // 11
  153. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  154. //action :ActionCommitRepo
  155. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  156. //issue // 10
  157. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  158. //comment table current date
  159. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  160. //watch table current date
  161. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  162. //star table current date
  163. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  164. //follow table
  165. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  166. // user table
  167. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  168. //
  169. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  170. //attachement table
  171. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  172. //0
  173. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  174. //issue, issueassignees
  175. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  176. //baike
  177. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  178. //user
  179. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  180. //repo
  181. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  182. //login count, from elk
  183. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  184. //openi index
  185. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  186. //user
  187. Email string `xorm:"NOT NULL"`
  188. //user
  189. Name string `xorm:"NOT NULL"`
  190. DataDate string `xorm:"NULL"`
  191. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  192. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  193. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  194. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  195. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  196. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  197. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  198. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  199. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  200. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  201. UserIndexPrimitive float64 `xorm:"NOT NULL DEFAULT 0"`
  202. UserLocation string `xorm:"NULL"`
  203. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  204. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  205. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  206. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  207. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  208. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  209. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  210. Phone string `xorm:"NULL"`
  211. InvitationUserNum int `xorm:"NOT NULL DEFAULT 0"`
  212. }
  213. type UserBusinessAnalysisCurrentMonth struct {
  214. ID int64 `xorm:"pk"`
  215. CountDate int64 `xorm:"pk"`
  216. //action :ActionMergePullRequest // 11
  217. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  218. //action :ActionCommitRepo
  219. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  220. //issue // 10
  221. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  222. //comment table current date
  223. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  224. //watch table current date
  225. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  226. //star table current date
  227. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  228. //follow table
  229. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  230. // user table
  231. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  232. //
  233. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  234. //attachement table
  235. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  236. //0
  237. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  238. //issue, issueassignees
  239. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  240. //baike
  241. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  242. //user
  243. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  244. //repo
  245. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  246. //login count, from elk
  247. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  248. //openi index
  249. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  250. //user
  251. Email string `xorm:"NOT NULL"`
  252. //user
  253. Name string `xorm:"NOT NULL"`
  254. DataDate string `xorm:"NULL"`
  255. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  256. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  257. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  258. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  259. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  260. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  261. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  262. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  263. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  264. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  265. UserIndexPrimitive float64 `xorm:"NOT NULL DEFAULT 0"`
  266. UserLocation string `xorm:"NULL"`
  267. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  268. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  269. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  270. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  271. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  272. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  273. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  274. Phone string `xorm:"NULL"`
  275. InvitationUserNum int `xorm:"NOT NULL DEFAULT 0"`
  276. }
  277. type UserBusinessAnalysisCurrentWeek struct {
  278. ID int64 `xorm:"pk"`
  279. CountDate int64 `xorm:"pk"`
  280. //action :ActionMergePullRequest // 11
  281. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  282. //action :ActionCommitRepo
  283. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  284. //issue // 10
  285. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  286. //comment table current date
  287. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  288. //watch table current date
  289. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  290. //star table current date
  291. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  292. //follow table
  293. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  294. // user table
  295. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  296. //
  297. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  298. //attachement table
  299. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  300. //0
  301. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  302. //issue, issueassignees
  303. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  304. //baike
  305. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  306. //user
  307. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  308. //repo
  309. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  310. //login count, from elk
  311. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  312. //openi index
  313. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  314. //user
  315. Email string `xorm:"NOT NULL"`
  316. //user
  317. Name string `xorm:"NOT NULL"`
  318. DataDate string `xorm:"NULL"`
  319. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  320. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  321. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  322. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  323. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  324. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  325. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  326. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  327. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  328. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  329. UserIndexPrimitive float64 `xorm:"NOT NULL DEFAULT 0"`
  330. UserLocation string `xorm:"NULL"`
  331. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  332. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  333. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  334. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  335. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  336. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  337. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  338. Phone string `xorm:"NULL"`
  339. InvitationUserNum int `xorm:"NOT NULL DEFAULT 0"`
  340. }
  341. type UserBusinessAnalysisYesterday struct {
  342. ID int64 `xorm:"pk"`
  343. CountDate int64 `xorm:"pk"`
  344. //action :ActionMergePullRequest // 11
  345. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  346. //action :ActionCommitRepo
  347. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  348. //issue // 10
  349. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  350. //comment table current date
  351. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  352. //watch table current date
  353. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  354. //star table current date
  355. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  356. //follow table
  357. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  358. // user table
  359. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  360. //
  361. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  362. //attachement table
  363. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  364. //0
  365. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  366. //issue, issueassignees
  367. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  368. //baike
  369. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  370. //user
  371. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  372. //repo
  373. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  374. //login count, from elk
  375. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  376. //openi index
  377. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  378. //user
  379. Email string `xorm:"NOT NULL"`
  380. //user
  381. Name string `xorm:"NOT NULL"`
  382. DataDate string `xorm:"NULL"`
  383. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  384. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  385. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  386. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  387. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  388. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  389. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  390. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  391. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  392. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  393. UserIndexPrimitive float64 `xorm:"NOT NULL DEFAULT 0"`
  394. UserLocation string `xorm:"NULL"`
  395. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  396. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  397. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  398. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  399. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  400. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  401. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  402. Phone string `xorm:"NULL"`
  403. InvitationUserNum int `xorm:"NOT NULL DEFAULT 0"`
  404. }
  405. type UserBusinessAnalysisLastWeek struct {
  406. ID int64 `xorm:"pk"`
  407. CountDate int64 `xorm:"pk"`
  408. //action :ActionMergePullRequest // 11
  409. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  410. //action :ActionCommitRepo
  411. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  412. //issue // 10
  413. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  414. //comment table current date
  415. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  416. //watch table current date
  417. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  418. //star table current date
  419. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  420. //follow table
  421. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  422. // user table
  423. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  424. //
  425. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  426. //attachement table
  427. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  428. //0
  429. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  430. //issue, issueassignees
  431. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  432. //baike
  433. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  434. //user
  435. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  436. //repo
  437. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  438. //login count, from elk
  439. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  440. //openi index
  441. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  442. //user
  443. Email string `xorm:"NOT NULL"`
  444. //user
  445. Name string `xorm:"NOT NULL"`
  446. DataDate string `xorm:"NULL"`
  447. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  448. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  449. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  450. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  451. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  452. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  453. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  454. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  455. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  456. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  457. UserIndexPrimitive float64 `xorm:"NOT NULL DEFAULT 0"`
  458. UserLocation string `xorm:"NULL"`
  459. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  460. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  461. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  462. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  463. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  464. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  465. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  466. Phone string `xorm:"NULL"`
  467. InvitationUserNum int `xorm:"NOT NULL DEFAULT 0"`
  468. }
  469. type UserAnalysisPara struct {
  470. Key string `xorm:"NOT NULL"`
  471. Value float64 `xorm:"NOT NULL DEFAULT 0"`
  472. }
  473. type UserMetrics struct {
  474. CountDate int64 `xorm:"pk"`
  475. ActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"` //当天激活用户
  476. NotActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"` //当天未激活用户
  477. ActivateIndex float64 `xorm:"NOT NULL DEFAULT 0"` //激活比率
  478. RegistActivityUser int `xorm:"NOT NULL DEFAULT 0"` //当天注册激活的人中,有贡献活动的人
  479. HasActivityUser int `xorm:"NOT NULL DEFAULT 0"` //当天有贡献活动的人
  480. TotalUser int `xorm:"NOT NULL DEFAULT 0"`
  481. TotalRegistUser int `xorm:"-"`
  482. TotalActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"`
  483. TotalNotActivateRegistUser int `xorm:"-"`
  484. TotalHasActivityUser int `xorm:"NOT NULL DEFAULT 0"`
  485. DisplayDate string `xorm:"-"`
  486. DataDate string `xorm:"NULL"`
  487. DaysForMonth int `xorm:"NOT NULL DEFAULT 0"`
  488. HasActivityUserJson string `xorm:"text NULL"` //贡献活动用户列表
  489. ActivityUserJson string `xorm:"text NULL"` //激活用户列表
  490. CurrentDayRegistUser int `xorm:"NOT NULL DEFAULT 0"` //当天注册用户
  491. }
  492. type UserBusinessAnalysisAll struct {
  493. ID int64 `xorm:"pk"`
  494. CountDate int64 `xorm:"pk"`
  495. //action :ActionMergePullRequest // 11
  496. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  497. //action :ActionCommitRepo // 5
  498. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  499. //action :ActionCreateIssue // 10
  500. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  501. //comment table current date
  502. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  503. //watch table current date
  504. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  505. //star table current date
  506. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  507. //follow table
  508. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  509. // user table
  510. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  511. //
  512. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  513. //attachement table
  514. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  515. //0
  516. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  517. //issue, issueassignees
  518. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  519. //baike
  520. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  521. //user
  522. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  523. //repo
  524. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  525. //login count, from elk
  526. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  527. //openi index
  528. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  529. //user
  530. Email string `xorm:"NOT NULL"`
  531. //user
  532. Name string `xorm:"NOT NULL"`
  533. DataDate string `xorm:"NULL"`
  534. //cloudbraintask
  535. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  536. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  537. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  538. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  539. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  540. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  541. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  542. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  543. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  544. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  545. UserIndexPrimitive float64 `xorm:"NOT NULL DEFAULT 0"`
  546. UserLocation string `xorm:"NULL"`
  547. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  548. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  549. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  550. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  551. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  552. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  553. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  554. Phone string `xorm:"NULL"`
  555. InvitationUserNum int `xorm:"NOT NULL DEFAULT 0"`
  556. }
  557. type UserBusinessAnalysis struct {
  558. ID int64 `xorm:"pk"`
  559. DataDate string `xorm:"pk"`
  560. CountDate int64 `xorm:"NULL"`
  561. //action :ActionMergePullRequest // 11
  562. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  563. //action :ActionCommitRepo // 5
  564. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  565. //action :ActionCreateIssue // 6
  566. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  567. //comment table current date
  568. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  569. //watch table current date
  570. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  571. //star table current date
  572. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  573. //follow table
  574. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  575. // user table
  576. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  577. //
  578. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  579. //attachement table
  580. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  581. //0
  582. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  583. //issue, issueassignees
  584. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  585. //baike
  586. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  587. //user
  588. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  589. //repo
  590. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  591. //login count, from elk
  592. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  593. //openi index
  594. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  595. //user
  596. Email string `xorm:"NOT NULL"`
  597. //user
  598. Name string `xorm:"NOT NULL"`
  599. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  600. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  601. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  602. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  603. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  604. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  605. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  606. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  607. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  608. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  609. UserIndexPrimitive float64 `xorm:"NOT NULL DEFAULT 0"`
  610. UserLocation string `xorm:"NULL"`
  611. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  612. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  613. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  614. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  615. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  616. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  617. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  618. Phone string `xorm:"NULL"`
  619. InvitationUserNum int `xorm:"NOT NULL DEFAULT 0"`
  620. }