dash.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. package forms
  2. import (
  3. "errors"
  4. "gadmin/internal/gorm/model"
  5. )
  6. type DictItem struct {
  7. Key string `json:"name"`
  8. Val int32 `json:"code"`
  9. Id int32 `json:"id"`
  10. }
  11. type CateDictData struct {
  12. Category string `json:"category"`
  13. Items []DictItem `json:"items"`
  14. }
  15. type DictRespData struct {
  16. Code int32 `json:"code"`
  17. Data []CateDictData `json:"data"`
  18. }
  19. // dict字典end
  20. // loginlog
  21. type LoginlogReq struct {
  22. ChannelId string `json:"channel_id" form:"channel_id"`
  23. EventId int32 `form:"eventId"`
  24. UserType int32 `form:"userType"`
  25. Day string `form:"day"`
  26. Page int `form:"page"`
  27. PerPage int `form:"perPage"`
  28. ServerId int `json:"server_id" form:"server_id"`
  29. }
  30. type LoginEventData struct {
  31. Key int64 `json:"key"`
  32. EventId int64 `json:"event_id"` // 事件id
  33. EventName string `json:"event_name"` // 事件名称
  34. UserCount int64 `json:"user_count"` // 用户数量
  35. Count int64 `json:"count"` // 事件次数
  36. Cost int64 `json:"cost"` // 耗时均值
  37. }
  38. type LoginEventRespData struct {
  39. Code int32 `json:"code"`
  40. Msg string `json:"msg"`
  41. Data []LoginEventData `json:"data"`
  42. }
  43. // 登陆事件end
  44. type UserChapterLogReq struct {
  45. ChannelId string `json:"channel_id" form:"channel_id"`
  46. Day string `form:"day"`
  47. Days int64 `form:"days"`
  48. ChapterId int64 `form:"chapter_id"`
  49. Difficulty int64 `form:"difficulty"`
  50. ServerId int `json:"server_id" form:"server_id"`
  51. Flag int32 `json:"flag" form:"flag"`
  52. }
  53. type UserChapterItem struct {
  54. Id int `json:"key"`
  55. RoomId int32 `json:"room_id"`
  56. Count int32 `json:"count"`
  57. SettelCount int32 `json:"settle_count"`
  58. }
  59. type UserChapterLogData struct {
  60. Chapter1 []UserChapterItem `json:"chapter1"`
  61. Chapter2 []UserChapterItem `json:"chapter2"`
  62. Chapter3 []UserChapterItem `json:"chapter3"`
  63. }
  64. type UserChapterLogRespData struct {
  65. Code int32 `json:"code"`
  66. Data []UserChapterItem `json:"data"`
  67. }
  68. // 关卡数据end
  69. // 死亡数据
  70. type DieDataReq struct {
  71. ListReq
  72. ChannelId string `json:"channel_id" form:"channel_id"`
  73. Day string `form:"day"`
  74. EndDay string `form:"endDay"`
  75. ServerId int `json:"server_id" form:"server_id"`
  76. Flag int32 `json:"flag" form:"flag"`
  77. }
  78. type DieInfoItem struct {
  79. Id int `json:"key"`
  80. Index int `json:"index"`
  81. ChapterId int `json:"chapter_id"`
  82. Chapter string `json:"chapter"`
  83. DifficultyIndex int `json:"difficulty_index"`
  84. Difficulty string `json:"difficulty"`
  85. DieCount int `json:"die_count"`
  86. DieUserCount int `json:"die_user_count"`
  87. NewDieCount int `json:"new_die_count"`
  88. NewDieUserCount int `json:"new_die_user_count"`
  89. }
  90. type DieRespData struct {
  91. ListRes
  92. }
  93. type DieInfoItemSlice []DieInfoItem
  94. func (p DieInfoItemSlice) Len() int {
  95. return len(p)
  96. }
  97. func (p DieInfoItemSlice) Swap(i, j int) {
  98. p[i], p[j] = p[j], p[i]
  99. }
  100. func (p DieInfoItemSlice) Less(i, j int) bool {
  101. return p[j].Index > p[i].Index
  102. }
  103. // 死亡数据 end
  104. type ConditionItem struct {
  105. Id int32 `json:"key"`
  106. ConditionId int32 `json:"condition_id"`
  107. Name string `json:"name"`
  108. Val int `json:"val"`
  109. }
  110. type BasicInfoReq struct {
  111. Day string `form:"day"`
  112. ServerId int `json:"server_id" form:"server_id"`
  113. }
  114. type BasicInfoItem struct {
  115. ID int `json:"key"`
  116. Name string `json:"name"`
  117. Count int64 `json:"count"`
  118. }
  119. type BasicRespData struct {
  120. Code int32 `json:"code"`
  121. Msg string `json:"msg"`
  122. Data []BasicInfoItem `json:"data"`
  123. }
  124. type BasicReportReq struct {
  125. ChannelId string `json:"channel_id" form:"channel_id"`
  126. Page int64 `json:"page" form:"page"`
  127. PerPage int64 `json:"pageSize" form:"pageSize"`
  128. ServerId int `json:"server_id" form:"server_id"`
  129. Flag int32 `json:"flag" form:"flag"`
  130. IsExport int `json:"is_export" form:"is_export"`
  131. }
  132. type BasicReportItem struct {
  133. ID int64 `json:"key"`
  134. Date string `json:"date"`
  135. OldCount int64 `json:"old_count"`
  136. NewCount int64 `json:"new_count"`
  137. ActiveCount int64 `json:"active_count"`
  138. ValidCount int64 `json:"valid_count"`
  139. NewDuration int64 `json:"new_duration"`
  140. ValidDuration int64 `json:"valid_duration"`
  141. ActiveDuration int64 `json:"active_duration"`
  142. Day1Active int64 `json:"day_1_active"`
  143. Day2Active int64 `json:"day_2_active"`
  144. Day3Active int64 `json:"day_3_active"`
  145. Day4Active int64 `json:"day_4_active"`
  146. Day5Active int64 `json:"day_5_active"`
  147. Day6Active int64 `json:"day_6_active"`
  148. Day7Active int64 `json:"day_7_active"`
  149. Day14Active int64 `json:"day_14_active"`
  150. Day30Active int64 `json:"day_30_active"`
  151. }
  152. type BasicReportRespData struct {
  153. Code int32 `json:"code"`
  154. Msg string `json:"msg"`
  155. Data []BasicReportItem `json:"data"`
  156. Total int64 `json:"total"`
  157. }
  158. type ConditionReportReq struct {
  159. ChannelId string `json:"channel_id" form:"channel_id"`
  160. Page int64 `json:"page" form:"page"`
  161. PerPage int64 `json:"pageSize" form:"pageSize"`
  162. ServerId int `json:"server_id" form:"server_id"`
  163. Flag int32 `json:"flag" form:"flag"`
  164. }
  165. type ConditionReportItem struct {
  166. ID int64 `json:"key"`
  167. ConditionId int64 `json:"condition_id"`
  168. Name string `json:"name"`
  169. Date string `json:"date"`
  170. GuideFinishedCount int64 `json:"guideFinishedCount"`
  171. NewCount int64 `json:"count"`
  172. Day1Active int64 `json:"day_1_active"`
  173. Day2Active int64 `json:"day_2_active"`
  174. Day3Active int64 `json:"day_3_active"`
  175. Day4Active int64 `json:"day_4_active"`
  176. Day5Active int64 `json:"day_5_active"`
  177. Day6Active int64 `json:"day_6_active"`
  178. Day7Active int64 `json:"day_7_active"`
  179. Day14Active int64 `json:"day_14_active"`
  180. Day30Active int64 `json:"day_30_active"`
  181. }
  182. type ConditionReportRespData struct {
  183. Code int32 `json:"code"`
  184. Msg string `json:"msg"`
  185. Data []ConditionReportItem `json:"data"`
  186. Total int64 `json:"total"`
  187. }
  188. // 基础用户数据 end
  189. // QueryAdvEchartsReq 广告点位折线
  190. type QueryAdvEchartsReq struct {
  191. ChannelId string `json:"channel_id" form:"channel_id"`
  192. PositionId int64 `form:"position_id"`
  193. Day string `form:"day"`
  194. EndDay string `form:"endDay"`
  195. ServerId int `json:"server_id" form:"server_id"`
  196. }
  197. // adv
  198. type AdvReportReq struct {
  199. ChannelId string `json:"channel_id" form:"channel_id"`
  200. Day string `form:"day"`
  201. Page int `form:"page"`
  202. PerPage int `form:"pageSize"`
  203. ServerId int `json:"server_id" form:"server_id"`
  204. Flag int32 `json:"flag" form:"flag"`
  205. }
  206. type AdvReportItem struct {
  207. ID int64 `json:"key"`
  208. PositionId int64 `json:"position_id"`
  209. ShowTimes int64 `json:"show_times"`
  210. ClickTimes int64 `json:"click_times"`
  211. RewardTimes int64 `json:"reward_times"`
  212. ShowUsers int64 `json:"show_users"`
  213. ClickUsers int64 `json:"click_users"`
  214. RewardUsers int64 `json:"reward_users"`
  215. }
  216. type AdvReportRespData struct {
  217. Code int32 `json:"code"`
  218. Msg string `json:"msg"`
  219. Data []AdvReportItem `json:"data"`
  220. Total int64 `json:"total"`
  221. }
  222. type AdvDetailsReq struct {
  223. ChannelId string `json:"channel_id" form:"channel_id"`
  224. Day string `form:"day"` // 哪一天的数据
  225. Days string `form:"days"` // 首日为0,昨日为1,前天为2
  226. ServerId int `json:"server_id" form:"server_id"`
  227. Flag int32 `json:"flag" form:"flag"`
  228. }
  229. type AdvUserDetailsReq struct {
  230. UserId int64 `json:"user_id" form:"user_id"`
  231. EventAt []int64 `json:"event_at" form:"event_at[]"`
  232. }
  233. func (req *AdvUserDetailsReq) Check() error {
  234. if req.EventAt != nil && len(req.EventAt) != 2 {
  235. return errors.New("时间必须选择一个区间或者留空")
  236. }
  237. if len(req.EventAt) == 2 {
  238. if req.EventAt[0] > req.EventAt[1] {
  239. return errors.New("时间选择的区间值不合理")
  240. }
  241. // 默认是毫秒
  242. req.EventAt[0] = req.EventAt[0] / 1000
  243. req.EventAt[1] = req.EventAt[1] / 1000
  244. }
  245. return nil
  246. }
  247. type AdvUserReportItem struct {
  248. ID int64 `json:"key"`
  249. PositionId int64 `json:"position_id"`
  250. ShowTimes int64 `json:"show_times"`
  251. ClickTimes int64 `json:"click_times"`
  252. RewardTimes int64 `json:"reward_times"`
  253. }
  254. type AdvUserReportRespData struct {
  255. Code int32 `json:"code"`
  256. Msg string `json:"msg"`
  257. Data []*AdvUserReportItem `json:"data"`
  258. Total int64 `json:"total"`
  259. }
  260. type FirstAdvReq struct {
  261. ChannelId string `json:"channel_id" form:"channel_id"`
  262. Page int64 `json:"page" form:"page"`
  263. PerPage int64 `json:"pageSize" form:"pageSize"`
  264. ServerId int `json:"server_id" form:"server_id"`
  265. }
  266. type FirstAdvRespData struct {
  267. Code int32 `json:"code"`
  268. Msg string `json:"msg"`
  269. Data []FirstAdvItem `json:"data"`
  270. Total int64 `json:"total"`
  271. }
  272. type FirstAdvItem struct {
  273. ID int64 `json:"key"`
  274. Date string `json:"date"`
  275. Goto int64 `json:"goto"`
  276. A int64 `json:"a"`
  277. B int64 `json:"b"`
  278. C int64 `json:"c"`
  279. Waive int64 `json:"waive"`
  280. EquipNow int64 `json:"equipNow"`
  281. }
  282. type AdvSummReq struct {
  283. ChannelId string `json:"channel_id" form:"channel_id"`
  284. Page int64 `json:"page" form:"page"`
  285. PerPage int64 `json:"pageSize" form:"pageSize"`
  286. ServerId int `json:"server_id" form:"server_id"`
  287. Flag int32 `json:"flag" form:"flag"`
  288. IsExport int32 `json:"is_export" form:"is_export"`
  289. }
  290. type AdvSummRespData struct {
  291. Code int32 `json:"code"`
  292. Msg string `json:"msg"`
  293. Data []AdvSummItem `json:"data"`
  294. Total int64 `json:"total"`
  295. }
  296. type AdvSummItem struct {
  297. ID int64 `json:"key"`
  298. Date string `json:"date"`
  299. RewardTimes int64 `json:"rewardTimes"`
  300. RewardUsers int64 `json:"rewardUsers"`
  301. NewTimes int64 `json:"newTimes"`
  302. NewUsers int64 `json:"newUsers"`
  303. OldTimes int64 `json:"oldTimes"`
  304. OldUsers int64 `json:"oldUsers"`
  305. // 人数相关
  306. ActiveCount int64 `json:"activeCount"`
  307. NewCount int64 `json:"newCount"`
  308. OldCount int64 `json:"oldCount"`
  309. }
  310. type GradeDistributionReq struct {
  311. ChannelId string `json:"channel_id" form:"channel_id"`
  312. ServerId int `json:"server_id" form:"server_id"`
  313. Day string `form:"day"`
  314. EndDay string `form:"endDay"`
  315. }
  316. type GoodsReportReq struct {
  317. ChannelId string `json:"channel_id" form:"channel_id"`
  318. Day string `form:"day"`
  319. EndDay string `form:"endDay"`
  320. Page int `form:"page"`
  321. PerPage int `form:"pageSize"`
  322. ServerId int `json:"server_id" form:"server_id"`
  323. Flag int32 `json:"flag" form:"flag"`
  324. }
  325. type GoodsReportItem struct {
  326. ID int64 `json:"key"`
  327. PositionId int64 `json:"position_id"`
  328. GoodsId int64 `json:"goods_id"`
  329. ShowTimes int64 `json:"show_times"`
  330. ClickTimes int64 `json:"click_times"`
  331. SuccessTimes int64 `json:"success_times"`
  332. ShowUsers int64 `json:"show_users"`
  333. ClickUsers int64 `json:"click_users"`
  334. SuccessUsers int64 `json:"success_users"`
  335. Comment string `json:"comment"`
  336. }
  337. type GoodsReportRespData struct {
  338. Code int32 `json:"code"`
  339. Msg string `json:"msg"`
  340. Data []GoodsReportItem `json:"data"`
  341. Total int64 `json:"total"`
  342. }
  343. // QueryBasicRetentionReq 查询基础留存率
  344. type QueryBasicRetentionReq struct {
  345. ChannelId string `json:"channel_id" form:"channel_id"`
  346. Day string `form:"day"`
  347. EndDay string `form:"endDay"`
  348. ServerId int `json:"server_id" form:"server_id"`
  349. Flag int32 `json:"flag" form:"flag"`
  350. }
  351. // adv end
  352. // ExpeditionReportReq 统计远征信息
  353. type ExpeditionReportReq struct {
  354. ChannelId string `json:"channel_id" form:"channel_id"`
  355. Day string `form:"day"`
  356. EndDay string `form:"endDay"`
  357. Page int `form:"page"`
  358. PerPage int `form:"pageSize"`
  359. ServerId int `json:"server_id" form:"server_id"`
  360. }
  361. // ExpeditionFloorReq 远征关卡未通关信息
  362. type ExpeditionFloorReq struct {
  363. ChannelId string `json:"channel_id" form:"channel_id"`
  364. Day string `form:"day"`
  365. ServerId int `json:"server_id" form:"server_id"`
  366. }
  367. // DuelReportReq 狭路对决远征信息
  368. type DuelReportReq struct {
  369. ChannelId string `json:"channel_id" form:"channel_id"`
  370. Day string `form:"day"`
  371. EndDay string `form:"endDay"`
  372. Page int `form:"page"`
  373. PerPage int `form:"pageSize"`
  374. ServerId int `json:"server_id" form:"server_id"`
  375. }
  376. // IdiomReportReq 金榜题名报表
  377. type IdiomReportReq struct {
  378. ChannelId string `json:"channel_id" form:"channel_id"`
  379. Day string `form:"day"`
  380. EndDay string `form:"endDay"`
  381. Page int `form:"page"`
  382. PerPage int `form:"pageSize"`
  383. ServerId int `json:"server_id" form:"server_id"`
  384. }
  385. // BossReportReq 暗影突袭报表
  386. type BossReportReq struct {
  387. ChannelId string `json:"channel_id" form:"channel_id"`
  388. Day string `form:"day"`
  389. EndDay string `form:"endDay"`
  390. Page int `form:"page"`
  391. PerPage int `form:"pageSize"`
  392. ServerId int `json:"server_id" form:"server_id"`
  393. }
  394. type HeroLevelDistributedReq struct {
  395. ChannelId string `json:"channel_id" form:"channel_id"`
  396. Day string `form:"day"`
  397. StartLevel int `form:"startLevel"`
  398. EndLevel int `form:"endLevel"`
  399. ServerId int `json:"server_id" form:"server_id"`
  400. }
  401. type HeroLevelDistributedRespData struct {
  402. HeroName []string `json:"heroName""`
  403. Level []string `json:"level"`
  404. Data []*HeroLevelDistributedItem `json:"data""`
  405. }
  406. type HeroLevelDistributedItem struct {
  407. Data []int `json:"data""`
  408. Type string `json:"type""`
  409. Name string `json:"name""`
  410. }
  411. // SevenBasicReq 七日任务基础信息
  412. type SevenBasicReq struct {
  413. ChannelId string `json:"channel_id" form:"channel_id"`
  414. Page int64 `json:"page" form:"page"`
  415. PerPage int64 `json:"pageSize" form:"pageSize"`
  416. ServerId int `json:"server_id" form:"server_id"`
  417. }
  418. type SevenBasicItem struct {
  419. ID int64 `json:"id"`
  420. Date string `json:"date"`
  421. PlayerCount int64 `json:"player_count"`
  422. ValidCount int64 `json:"valid_count"`
  423. NewPlayerCount int64 `json:"new_player_count"`
  424. OpenCount int64 `json:"open_count"`
  425. AllTaskSucCount int64 `json:"all_task_suc_count"`
  426. Unlock1 int64 `json:"unlock1"`
  427. Unlock2 int64 `json:"unlock2"`
  428. Unlock3 int64 `json:"unlock3"`
  429. Unlock4 int64 `json:"unlock4"`
  430. Unlock5 int64 `json:"unlock5"`
  431. Unlock6 int64 `json:"unlock6"`
  432. Unlock7 int64 `json:"unlock7"`
  433. }
  434. type SevenBasicRespData struct {
  435. Code int32 `json:"code"`
  436. Msg string `json:"msg"`
  437. Data []SevenBasicItem `json:"data"`
  438. Total int64 `json:"total"`
  439. }
  440. // SevenTaskReq 七日任务任务统计
  441. type SevenTaskReq struct {
  442. Day string `form:"day"`
  443. EndDay string `form:"endDay"`
  444. Page int64 `json:"page" form:"page"`
  445. PerPage int64 `json:"pageSize" form:"pageSize"`
  446. ServerId int `json:"server_id" form:"server_id"`
  447. }
  448. type SevenTaskItem struct {
  449. ID int64 `json:"id"`
  450. TaskID int64 `json:"taskId"`
  451. Describe string `json:"describe"`
  452. DayValue int64 `json:"dayValue"`
  453. SucCount int64 `json:"sucCount"`
  454. FirstSucCount int64 `json:"firstSucCount"`
  455. AdvSucDays float64 `json:"advSucDays"`
  456. }
  457. type SevenTaskRespData struct {
  458. Code int32 `json:"code"`
  459. Msg string `json:"msg"`
  460. Data []*SevenTaskItem `json:"data"`
  461. Total int64 `json:"total"`
  462. }
  463. // SevenAwardReq 七日任务奖励统计
  464. type SevenAwardReq struct {
  465. Day string `form:"day"`
  466. EndDay string `form:"endDay"`
  467. Page int64 `json:"page" form:"page"`
  468. PerPage int64 `json:"pageSize" form:"pageSize"`
  469. ServerId int `json:"server_id" form:"server_id"`
  470. }
  471. type SevenAwardItem struct {
  472. ID int64 `json:"id"`
  473. TaskID int64 `json:"taskId"`
  474. Describe string `json:"describe"`
  475. DayValue int64 `json:"dayValue"`
  476. SucCount int64 `json:"sucCount"`
  477. FirstSucCount int64 `json:"firstSucCount"`
  478. AdvSucDays float64 `json:"advSucDays"`
  479. }
  480. type SevenAwardRespData struct {
  481. Code int32 `json:"code"`
  482. Msg string `json:"msg"`
  483. Data []*SevenAwardItem `json:"data"`
  484. Total int64 `json:"total"`
  485. }
  486. // DisconnectListReq 断线重连统计
  487. type DisconnectListReq struct {
  488. ChannelId string `json:"channel_id" form:"channel_id"`
  489. Day string `form:"day"`
  490. EndDay string `form:"endDay"`
  491. Page int64 `json:"page" form:"page"`
  492. PerPage int64 `json:"pageSize" form:"pageSize"`
  493. ServerId int `json:"server_id" form:"server_id"`
  494. }
  495. type DisconnectListItem struct {
  496. ID int32 `json:"id"`
  497. TaskID int64 `json:"taskId"`
  498. Describe string `json:"describe"`
  499. DayValue int64 `json:"dayValue"`
  500. SucCount int32 `json:"sucCount"`
  501. FirstSucCount int32 `json:"firstSucCount"`
  502. AdvSucDays float64 `json:"advSucDays"`
  503. }
  504. type DisconnectListRes struct {
  505. Code int32 `json:"code"`
  506. Msg string `json:"msg"`
  507. Data []*model.ReportDayDisconnect `json:"data"`
  508. Total int64 `json:"total"`
  509. }
  510. // GemReportReq 宝石报表
  511. type GemReportReq struct {
  512. ChannelId string `json:"channel_id" form:"channel_id"`
  513. Day string `form:"day"`
  514. EndDay string `form:"endDay"`
  515. Page int `form:"page"`
  516. PerPage int `form:"pageSize"`
  517. ServerId int `json:"server_id" form:"server_id"`
  518. }
  519. // GemStatReq 宝石统计
  520. type GemStatReq struct {
  521. ServerId int `json:"server_id" form:"server_id"`
  522. }
  523. // GemPartStatReq 部位宝石统计
  524. type GemPartStatReq struct {
  525. ServerId int `json:"server_id" form:"server_id"`
  526. }
  527. // LevelOutputReq 等级产出
  528. type LevelOutputReq struct {
  529. ChannelId string `json:"channel_id" form:"channel_id"`
  530. StartLevel int32 `form:"startLevel"`
  531. EndLevel int32 `form:"endLevel"`
  532. Page int `form:"page"`
  533. PerPage int `form:"pageSize"`
  534. ServerId int `json:"server_id" form:"server_id"`
  535. }