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 15 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. package models
  2. import "code.gitea.io/gitea/modules/timeutil"
  3. type UserBusinessAnalysisCurrentYear struct {
  4. ID int64 `xorm:"pk"`
  5. CountDate int64 `xorm:"pk"`
  6. //action :ActionMergePullRequest // 11
  7. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  8. //action :ActionCommitRepo
  9. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  10. //issue // 10
  11. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  12. //comment table current date
  13. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  14. //watch table current date
  15. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  16. //star table current date
  17. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  18. //follow table
  19. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  20. // user table
  21. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  22. //
  23. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  24. //attachement table
  25. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  26. //0
  27. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  28. //issue, issueassignees
  29. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  30. //baike
  31. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  32. //user
  33. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  34. //repo
  35. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  36. //login count, from elk
  37. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  38. //openi index
  39. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  40. //user
  41. Email string `xorm:"NOT NULL"`
  42. //user
  43. Name string `xorm:"NOT NULL"`
  44. DataDate string `xorm:"NULL"`
  45. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  46. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  47. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  48. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  49. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  50. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  51. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  52. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  53. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  54. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  55. UserLocation string `xorm:"NULL"`
  56. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  57. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  58. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  59. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  60. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  61. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  62. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  63. }
  64. type UserBusinessAnalysisLast30Day struct {
  65. ID int64 `xorm:"pk"`
  66. CountDate int64 `xorm:"pk"`
  67. //action :ActionMergePullRequest // 11
  68. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  69. //action :ActionCommitRepo
  70. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  71. //issue // 10
  72. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  73. //comment table current date
  74. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  75. //watch table current date
  76. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  77. //star table current date
  78. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  79. //follow table
  80. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  81. // user table
  82. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  83. //
  84. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  85. //attachement table
  86. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  87. //0
  88. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  89. //issue, issueassignees
  90. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  91. //baike
  92. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  93. //user
  94. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  95. //repo
  96. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  97. //login count, from elk
  98. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  99. //openi index
  100. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  101. //user
  102. Email string `xorm:"NOT NULL"`
  103. //user
  104. Name string `xorm:"NOT NULL"`
  105. DataDate string `xorm:"NULL"`
  106. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  107. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  108. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  109. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  110. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  111. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  112. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  113. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  114. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  115. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  116. UserLocation string `xorm:"NULL"`
  117. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  118. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  119. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  120. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  121. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  122. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  123. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  124. }
  125. type UserBusinessAnalysisLastMonth struct {
  126. ID int64 `xorm:"pk"`
  127. CountDate int64 `xorm:"pk"`
  128. //action :ActionMergePullRequest // 11
  129. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  130. //action :ActionCommitRepo
  131. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  132. //issue // 10
  133. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  134. //comment table current date
  135. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  136. //watch table current date
  137. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  138. //star table current date
  139. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  140. //follow table
  141. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  142. // user table
  143. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  144. //
  145. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  146. //attachement table
  147. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  148. //0
  149. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  150. //issue, issueassignees
  151. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  152. //baike
  153. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  154. //user
  155. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  156. //repo
  157. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  158. //login count, from elk
  159. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  160. //openi index
  161. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  162. //user
  163. Email string `xorm:"NOT NULL"`
  164. //user
  165. Name string `xorm:"NOT NULL"`
  166. DataDate string `xorm:"NULL"`
  167. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  168. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  169. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  170. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  171. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  172. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  173. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  174. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  175. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  176. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  177. UserLocation string `xorm:"NULL"`
  178. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  179. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  180. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  181. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  182. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  183. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  184. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  185. }
  186. type UserBusinessAnalysisCurrentMonth struct {
  187. ID int64 `xorm:"pk"`
  188. CountDate int64 `xorm:"pk"`
  189. //action :ActionMergePullRequest // 11
  190. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  191. //action :ActionCommitRepo
  192. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  193. //issue // 10
  194. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  195. //comment table current date
  196. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  197. //watch table current date
  198. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  199. //star table current date
  200. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  201. //follow table
  202. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  203. // user table
  204. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  205. //
  206. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  207. //attachement table
  208. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  209. //0
  210. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  211. //issue, issueassignees
  212. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  213. //baike
  214. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  215. //user
  216. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  217. //repo
  218. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  219. //login count, from elk
  220. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  221. //openi index
  222. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  223. //user
  224. Email string `xorm:"NOT NULL"`
  225. //user
  226. Name string `xorm:"NOT NULL"`
  227. DataDate string `xorm:"NULL"`
  228. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  229. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  230. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  231. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  232. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  233. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  234. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  235. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  236. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  237. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  238. UserLocation string `xorm:"NULL"`
  239. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  240. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  241. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  242. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  243. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  244. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  245. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  246. }
  247. type UserBusinessAnalysisCurrentWeek struct {
  248. ID int64 `xorm:"pk"`
  249. CountDate int64 `xorm:"pk"`
  250. //action :ActionMergePullRequest // 11
  251. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  252. //action :ActionCommitRepo
  253. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  254. //issue // 10
  255. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  256. //comment table current date
  257. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  258. //watch table current date
  259. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  260. //star table current date
  261. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  262. //follow table
  263. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  264. // user table
  265. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  266. //
  267. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  268. //attachement table
  269. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  270. //0
  271. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  272. //issue, issueassignees
  273. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  274. //baike
  275. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  276. //user
  277. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  278. //repo
  279. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  280. //login count, from elk
  281. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  282. //openi index
  283. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  284. //user
  285. Email string `xorm:"NOT NULL"`
  286. //user
  287. Name string `xorm:"NOT NULL"`
  288. DataDate string `xorm:"NULL"`
  289. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  290. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  291. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  292. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  293. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  294. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  295. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  296. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  297. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  298. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  299. UserLocation string `xorm:"NULL"`
  300. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  301. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  302. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  303. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  304. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  305. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  306. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  307. }
  308. type UserBusinessAnalysisYesterday struct {
  309. ID int64 `xorm:"pk"`
  310. CountDate int64 `xorm:"pk"`
  311. //action :ActionMergePullRequest // 11
  312. CodeMergeCount int `xorm:"NOT NULL DEFAULT 0"`
  313. //action :ActionCommitRepo
  314. CommitCount int `xorm:"NOT NULL DEFAULT 0"`
  315. //issue // 10
  316. IssueCount int `xorm:"NOT NULL DEFAULT 0"`
  317. //comment table current date
  318. CommentCount int `xorm:"NOT NULL DEFAULT 0"`
  319. //watch table current date
  320. FocusRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  321. //star table current date
  322. StarRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  323. //follow table
  324. WatchedCount int `xorm:"NOT NULL DEFAULT 0"`
  325. // user table
  326. GiteaAgeMonth int `xorm:"NOT NULL DEFAULT 0"`
  327. //
  328. CommitCodeSize int `xorm:"NOT NULL DEFAULT 0"`
  329. //attachement table
  330. CommitDatasetSize int `xorm:"NOT NULL DEFAULT 0"`
  331. //0
  332. CommitModelCount int `xorm:"NOT NULL DEFAULT 0"`
  333. //issue, issueassignees
  334. SolveIssueCount int `xorm:"NOT NULL DEFAULT 0"`
  335. //baike
  336. EncyclopediasCount int `xorm:"NOT NULL DEFAULT 0"`
  337. //user
  338. RegistDate timeutil.TimeStamp `xorm:"NOT NULL"`
  339. //repo
  340. CreateRepoCount int `xorm:"NOT NULL DEFAULT 0"`
  341. //login count, from elk
  342. LoginCount int `xorm:"NOT NULL DEFAULT 0"`
  343. //openi index
  344. OpenIIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  345. //user
  346. Email string `xorm:"NOT NULL"`
  347. //user
  348. Name string `xorm:"NOT NULL"`
  349. DataDate string `xorm:"NULL"`
  350. CloudBrainTaskNum int `xorm:"NOT NULL DEFAULT 0"`
  351. GpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  352. NpuDebugJob int `xorm:"NOT NULL DEFAULT 0"`
  353. GpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  354. NpuTrainJob int `xorm:"NOT NULL DEFAULT 0"`
  355. NpuInferenceJob int `xorm:"NOT NULL DEFAULT 0"`
  356. GpuBenchMarkJob int `xorm:"NOT NULL DEFAULT 0"`
  357. CloudBrainRunTime int `xorm:"NOT NULL DEFAULT 0"`
  358. CommitDatasetNum int `xorm:"NOT NULL DEFAULT 0"`
  359. UserIndex float64 `xorm:"NOT NULL DEFAULT 0"`
  360. UserLocation string `xorm:"NULL"`
  361. FocusOtherUser int `xorm:"NOT NULL DEFAULT 0"`
  362. CollectDataset int `xorm:"NOT NULL DEFAULT 0"`
  363. CollectedDataset int `xorm:"NOT NULL DEFAULT 0"`
  364. RecommendDataset int `xorm:"NOT NULL DEFAULT 0"`
  365. CollectImage int `xorm:"NOT NULL DEFAULT 0"`
  366. CollectedImage int `xorm:"NOT NULL DEFAULT 0"`
  367. RecommendImage int `xorm:"NOT NULL DEFAULT 0"`
  368. }
  369. type UserAnalysisPara struct {
  370. Key string `xorm:"NOT NULL"`
  371. Value float64 `xorm:"NOT NULL DEFAULT 0"`
  372. }
  373. type UserMetrics struct {
  374. CountDate int64 `xorm:"pk"`
  375. ActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"`
  376. NotActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"`
  377. HasActivityUser int `xorm:"NOT NULL DEFAULT 0"`
  378. TotalActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"`
  379. TotalHasActivityUser int `xorm:"NOT NULL DEFAULT 0"`
  380. }