banner.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  1. package show
  2. import (
  3. "context"
  4. "go-common/app/interface/main/app-show/model"
  5. "go-common/app/interface/main/app-show/model/banner"
  6. resource "go-common/app/service/main/resource/model"
  7. "go-common/library/log"
  8. )
  9. var (
  10. _banners = map[string]map[int8]map[string]int{
  11. "-1": map[int8]map[string]int{
  12. model.PlatIPhone: map[string]int{
  13. "bottom": 467,
  14. },
  15. model.PlatAndroid: map[string]int{
  16. "bottom": 631,
  17. },
  18. model.PlatIPad: map[string]int{
  19. "bottom": 771,
  20. },
  21. model.PlatIPhoneI: map[string]int{
  22. "bottom": 947,
  23. },
  24. model.PlatAndroidG: map[string]int{
  25. "bottom": 1285,
  26. },
  27. model.PlatAndroidI: map[string]int{
  28. "bottom": 1707,
  29. },
  30. model.PlatIPadI: map[string]int{
  31. "bottom": 1117,
  32. },
  33. },
  34. "0": map[int8]map[string]int{
  35. model.PlatIPhone: map[string]int{
  36. "top": 467,
  37. "center": 468,
  38. "bottom": 469,
  39. },
  40. model.PlatAndroid: map[string]int{
  41. "top": 631,
  42. "center": 632,
  43. "bottom": 633,
  44. },
  45. model.PlatIPad: map[string]int{
  46. "top": 771,
  47. "center": 772,
  48. "bottom": 773,
  49. },
  50. model.PlatIPhoneI: map[string]int{
  51. "top": 947,
  52. "center": 952,
  53. "bottom": 957,
  54. },
  55. model.PlatAndroidG: map[string]int{
  56. "top": 1285,
  57. "center": 1290,
  58. "bottom": 1295,
  59. },
  60. model.PlatAndroidI: map[string]int{
  61. "top": 1707,
  62. "center": 1712,
  63. "bottom": 1717,
  64. },
  65. model.PlatIPadI: map[string]int{
  66. "top": 1117,
  67. "center": 1122,
  68. "bottom": 1127,
  69. },
  70. },
  71. "65537": map[int8]map[string]int{
  72. model.PlatIPhone: map[string]int{
  73. "bottom": 482,
  74. },
  75. model.PlatAndroid: map[string]int{
  76. "bottom": 646,
  77. },
  78. model.PlatIPad: map[string]int{
  79. "bottom": 786,
  80. },
  81. model.PlatIPhoneI: map[string]int{
  82. "bottom": 1013,
  83. },
  84. model.PlatAndroidG: map[string]int{
  85. "bottom": 1351,
  86. },
  87. model.PlatAndroidI: map[string]int{
  88. "bottom": 1773,
  89. },
  90. model.PlatIPadI: map[string]int{
  91. "bottom": 1183,
  92. },
  93. },
  94. "13": map[int8]map[string]int{
  95. model.PlatIPhone: map[string]int{
  96. "bottom": 471,
  97. },
  98. model.PlatAndroid: map[string]int{
  99. "bottom": 635,
  100. },
  101. model.PlatIPad: map[string]int{
  102. "bottom": 775,
  103. },
  104. model.PlatIPhoneI: map[string]int{
  105. "bottom": 967,
  106. },
  107. model.PlatAndroidG: map[string]int{
  108. "bottom": 1305,
  109. },
  110. model.PlatAndroidI: map[string]int{
  111. "bottom": 1727,
  112. },
  113. model.PlatIPadI: map[string]int{
  114. "bottom": 1137,
  115. },
  116. },
  117. "1": map[int8]map[string]int{
  118. model.PlatIPhone: map[string]int{
  119. "bottom": 470,
  120. },
  121. model.PlatAndroid: map[string]int{
  122. "bottom": 634,
  123. },
  124. model.PlatIPad: map[string]int{
  125. "bottom": 774,
  126. },
  127. model.PlatIPhoneI: map[string]int{
  128. "bottom": 962,
  129. },
  130. model.PlatAndroidG: map[string]int{
  131. "bottom": 1300,
  132. },
  133. model.PlatAndroidI: map[string]int{
  134. "bottom": 1722,
  135. },
  136. model.PlatIPadI: map[string]int{
  137. "bottom": 1132,
  138. },
  139. },
  140. "3": map[int8]map[string]int{
  141. model.PlatIPhone: map[string]int{
  142. "bottom": 472,
  143. },
  144. model.PlatAndroid: map[string]int{
  145. "bottom": 636,
  146. },
  147. model.PlatIPad: map[string]int{
  148. "bottom": 776,
  149. },
  150. model.PlatIPhoneI: map[string]int{
  151. "bottom": 971,
  152. },
  153. model.PlatAndroidG: map[string]int{
  154. "bottom": 1309,
  155. },
  156. model.PlatAndroidI: map[string]int{
  157. "bottom": 1731,
  158. },
  159. model.PlatIPadI: map[string]int{
  160. "bottom": 1141,
  161. },
  162. },
  163. "129": map[int8]map[string]int{
  164. model.PlatIPhone: map[string]int{
  165. "bottom": 473,
  166. },
  167. model.PlatAndroid: map[string]int{
  168. "bottom": 637,
  169. },
  170. model.PlatIPad: map[string]int{
  171. "bottom": 777,
  172. },
  173. model.PlatIPhoneI: map[string]int{
  174. "bottom": 975,
  175. },
  176. model.PlatAndroidG: map[string]int{
  177. "bottom": 1313,
  178. },
  179. model.PlatAndroidI: map[string]int{
  180. "bottom": 1735,
  181. },
  182. model.PlatIPadI: map[string]int{
  183. "bottom": 1145,
  184. },
  185. },
  186. "4": map[int8]map[string]int{
  187. model.PlatIPhone: map[string]int{
  188. "bottom": 474,
  189. },
  190. model.PlatAndroid: map[string]int{
  191. "bottom": 638,
  192. },
  193. model.PlatIPad: map[string]int{
  194. "bottom": 778,
  195. },
  196. model.PlatIPhoneI: map[string]int{
  197. "bottom": 979,
  198. },
  199. model.PlatAndroidG: map[string]int{
  200. "bottom": 1317,
  201. },
  202. model.PlatAndroidI: map[string]int{
  203. "bottom": 1739,
  204. },
  205. model.PlatIPadI: map[string]int{
  206. "bottom": 1149,
  207. },
  208. },
  209. "36": map[int8]map[string]int{
  210. model.PlatIPhone: map[string]int{
  211. "bottom": 475,
  212. },
  213. model.PlatAndroid: map[string]int{
  214. "bottom": 639,
  215. },
  216. model.PlatIPad: map[string]int{
  217. "bottom": 779,
  218. },
  219. model.PlatIPhoneI: map[string]int{
  220. "bottom": 983,
  221. },
  222. model.PlatAndroidG: map[string]int{
  223. "bottom": 1321,
  224. },
  225. model.PlatAndroidI: map[string]int{
  226. "bottom": 1706,
  227. },
  228. model.PlatIPadI: map[string]int{
  229. "bottom": 1153,
  230. },
  231. },
  232. "160": map[int8]map[string]int{
  233. model.PlatIPhone: map[string]int{
  234. "bottom": 476,
  235. },
  236. model.PlatAndroid: map[string]int{
  237. "bottom": 640,
  238. },
  239. model.PlatIPad: map[string]int{
  240. "bottom": 780,
  241. },
  242. model.PlatIPhoneI: map[string]int{
  243. "bottom": 987,
  244. },
  245. model.PlatAndroidG: map[string]int{
  246. "bottom": 1325,
  247. },
  248. model.PlatAndroidI: map[string]int{
  249. "bottom": 1747,
  250. },
  251. model.PlatIPadI: map[string]int{
  252. "bottom": 1157,
  253. },
  254. },
  255. "119": map[int8]map[string]int{
  256. model.PlatIPhone: map[string]int{
  257. "bottom": 477,
  258. },
  259. model.PlatAndroid: map[string]int{
  260. "bottom": 641,
  261. },
  262. model.PlatIPad: map[string]int{
  263. "bottom": 781,
  264. },
  265. model.PlatIPhoneI: map[string]int{
  266. "bottom": 992,
  267. },
  268. model.PlatAndroidG: map[string]int{
  269. "bottom": 1330,
  270. },
  271. model.PlatAndroidI: map[string]int{
  272. "bottom": 1752,
  273. },
  274. model.PlatIPadI: map[string]int{
  275. "bottom": 1162,
  276. },
  277. },
  278. "155": map[int8]map[string]int{
  279. model.PlatIPhone: map[string]int{
  280. "bottom": 478,
  281. },
  282. model.PlatAndroid: map[string]int{
  283. "bottom": 642,
  284. },
  285. model.PlatIPad: map[string]int{
  286. "bottom": 782,
  287. },
  288. model.PlatIPhoneI: map[string]int{
  289. "bottom": 997,
  290. },
  291. model.PlatAndroidG: map[string]int{
  292. "bottom": 1335,
  293. },
  294. model.PlatAndroidI: map[string]int{
  295. "bottom": 1757,
  296. },
  297. model.PlatIPadI: map[string]int{
  298. "bottom": 1167,
  299. },
  300. },
  301. "5": map[int8]map[string]int{
  302. model.PlatIPhone: map[string]int{
  303. "bottom": 479,
  304. },
  305. model.PlatAndroid: map[string]int{
  306. "bottom": 643,
  307. },
  308. model.PlatIPad: map[string]int{
  309. "bottom": 783,
  310. },
  311. model.PlatIPhoneI: map[string]int{
  312. "bottom": 1001,
  313. },
  314. model.PlatAndroidG: map[string]int{
  315. "bottom": 1339,
  316. },
  317. model.PlatAndroidI: map[string]int{
  318. "bottom": 1761,
  319. },
  320. model.PlatIPadI: map[string]int{
  321. "bottom": 1171,
  322. },
  323. },
  324. "23": map[int8]map[string]int{
  325. model.PlatIPhone: map[string]int{
  326. "bottom": 480,
  327. },
  328. model.PlatAndroid: map[string]int{
  329. "bottom": 644,
  330. },
  331. model.PlatIPad: map[string]int{
  332. "bottom": 784,
  333. },
  334. model.PlatIPhoneI: map[string]int{
  335. "bottom": 1005,
  336. },
  337. model.PlatAndroidG: map[string]int{
  338. "bottom": 1343,
  339. },
  340. model.PlatAndroidI: map[string]int{
  341. "bottom": 1765,
  342. },
  343. model.PlatIPadI: map[string]int{
  344. "bottom": 1175,
  345. },
  346. },
  347. "11": map[int8]map[string]int{
  348. model.PlatIPhone: map[string]int{
  349. "bottom": 481,
  350. },
  351. model.PlatAndroid: map[string]int{
  352. "bottom": 645,
  353. },
  354. model.PlatIPad: map[string]int{
  355. "bottom": 785,
  356. },
  357. model.PlatIPhoneI: map[string]int{
  358. "bottom": 1009,
  359. },
  360. model.PlatAndroidG: map[string]int{
  361. "bottom": 1347,
  362. },
  363. model.PlatAndroidI: map[string]int{
  364. "bottom": 1769,
  365. },
  366. model.PlatIPadI: map[string]int{
  367. "bottom": 1179,
  368. },
  369. },
  370. "165": map[int8]map[string]int{
  371. model.PlatIPhone: map[string]int{
  372. "bottom": 1643,
  373. },
  374. model.PlatAndroid: map[string]int{
  375. "bottom": 1639,
  376. },
  377. model.PlatIPad: map[string]int{
  378. "bottom": 1647,
  379. },
  380. model.PlatIPhoneI: map[string]int{
  381. "bottom": 1643,
  382. },
  383. model.PlatAndroidG: map[string]int{
  384. "bottom": 1639,
  385. },
  386. model.PlatIPadI: map[string]int{
  387. "bottom": 1647,
  388. },
  389. },
  390. "167": map[int8]map[string]int{
  391. model.PlatIPhone: map[string]int{
  392. "bottom": 1950,
  393. },
  394. model.PlatAndroid: map[string]int{
  395. "bottom": 1952,
  396. },
  397. model.PlatIPad: map[string]int{
  398. "bottom": 1951,
  399. },
  400. },
  401. "181": map[int8]map[string]int{
  402. model.PlatIPhone: map[string]int{
  403. "bottom": 2245,
  404. },
  405. model.PlatAndroid: map[string]int{
  406. "bottom": 2249,
  407. },
  408. model.PlatIPad: map[string]int{
  409. "bottom": 2253,
  410. },
  411. },
  412. "177": map[int8]map[string]int{
  413. model.PlatIPhone: map[string]int{
  414. "bottom": 2295,
  415. },
  416. model.PlatAndroid: map[string]int{
  417. "bottom": 2299,
  418. },
  419. model.PlatIPad: map[string]int{
  420. "bottom": 2303,
  421. },
  422. },
  423. }
  424. _bannersIndex = map[string]map[int8]map[string]int{
  425. "-1": map[int8]map[string]int{
  426. model.PlatIPhone: map[string]int{
  427. "top": 467,
  428. },
  429. model.PlatAndroid: map[string]int{
  430. "top": 631,
  431. },
  432. model.PlatIPad: map[string]int{
  433. "top": 771,
  434. },
  435. model.PlatIPhoneI: map[string]int{
  436. "top": 947,
  437. },
  438. model.PlatAndroidG: map[string]int{
  439. "top": 1285,
  440. },
  441. model.PlatAndroidI: map[string]int{
  442. "top": 1707,
  443. },
  444. model.PlatIPadI: map[string]int{
  445. "top": 1117,
  446. },
  447. },
  448. "0": map[int8]map[string]int{
  449. model.PlatIPhone: map[string]int{
  450. "top": 467,
  451. "center": 468,
  452. "bottom": 469,
  453. },
  454. model.PlatAndroid: map[string]int{
  455. "top": 631,
  456. "center": 632,
  457. "bottom": 633,
  458. },
  459. model.PlatIPad: map[string]int{
  460. "top": 771,
  461. "center": 772,
  462. "bottom": 773,
  463. },
  464. model.PlatIPhoneI: map[string]int{
  465. "top": 947,
  466. "center": 952,
  467. "bottom": 957,
  468. },
  469. model.PlatAndroidG: map[string]int{
  470. "top": 1285,
  471. "center": 1290,
  472. "bottom": 1295,
  473. },
  474. model.PlatAndroidI: map[string]int{
  475. "top": 1707,
  476. "center": 1712,
  477. "bottom": 1717,
  478. },
  479. model.PlatIPadI: map[string]int{
  480. "top": 1117,
  481. "center": 1122,
  482. "bottom": 1127,
  483. },
  484. },
  485. "65537": map[int8]map[string]int{
  486. model.PlatIPhone: map[string]int{
  487. "top": 482,
  488. },
  489. model.PlatAndroid: map[string]int{
  490. "top": 646,
  491. },
  492. model.PlatIPad: map[string]int{
  493. "top": 786,
  494. },
  495. model.PlatIPhoneI: map[string]int{
  496. "top": 1013,
  497. },
  498. model.PlatAndroidG: map[string]int{
  499. "top": 1351,
  500. },
  501. model.PlatAndroidI: map[string]int{
  502. "top": 1773,
  503. },
  504. model.PlatIPadI: map[string]int{
  505. "top": 1183,
  506. },
  507. },
  508. "13": map[int8]map[string]int{
  509. model.PlatIPhone: map[string]int{
  510. "top": 471,
  511. },
  512. model.PlatAndroid: map[string]int{
  513. "top": 635,
  514. },
  515. model.PlatIPad: map[string]int{
  516. "top": 775,
  517. },
  518. model.PlatIPhoneI: map[string]int{
  519. "top": 967,
  520. },
  521. model.PlatAndroidG: map[string]int{
  522. "top": 1305,
  523. },
  524. model.PlatAndroidI: map[string]int{
  525. "top": 1727,
  526. },
  527. model.PlatIPadI: map[string]int{
  528. "top": 1137,
  529. },
  530. },
  531. "1": map[int8]map[string]int{
  532. model.PlatIPhone: map[string]int{
  533. "top": 470,
  534. },
  535. model.PlatAndroid: map[string]int{
  536. "top": 634,
  537. },
  538. model.PlatIPad: map[string]int{
  539. "top": 774,
  540. },
  541. model.PlatIPhoneI: map[string]int{
  542. "top": 962,
  543. },
  544. model.PlatAndroidG: map[string]int{
  545. "top": 1300,
  546. },
  547. model.PlatAndroidI: map[string]int{
  548. "top": 1722,
  549. },
  550. model.PlatIPadI: map[string]int{
  551. "top": 1132,
  552. },
  553. },
  554. "3": map[int8]map[string]int{
  555. model.PlatIPhone: map[string]int{
  556. "top": 472,
  557. },
  558. model.PlatAndroid: map[string]int{
  559. "top": 636,
  560. },
  561. model.PlatIPad: map[string]int{
  562. "top": 776,
  563. },
  564. model.PlatIPhoneI: map[string]int{
  565. "top": 971,
  566. },
  567. model.PlatAndroidG: map[string]int{
  568. "top": 1309,
  569. },
  570. model.PlatAndroidI: map[string]int{
  571. "top": 1731,
  572. },
  573. model.PlatIPadI: map[string]int{
  574. "top": 1141,
  575. },
  576. },
  577. "129": map[int8]map[string]int{
  578. model.PlatIPhone: map[string]int{
  579. "top": 473,
  580. },
  581. model.PlatAndroid: map[string]int{
  582. "top": 637,
  583. },
  584. model.PlatIPad: map[string]int{
  585. "top": 777,
  586. },
  587. model.PlatIPhoneI: map[string]int{
  588. "top": 975,
  589. },
  590. model.PlatAndroidG: map[string]int{
  591. "top": 1313,
  592. },
  593. model.PlatAndroidI: map[string]int{
  594. "top": 1735,
  595. },
  596. model.PlatIPadI: map[string]int{
  597. "top": 1145,
  598. },
  599. },
  600. "4": map[int8]map[string]int{
  601. model.PlatIPhone: map[string]int{
  602. "top": 474,
  603. },
  604. model.PlatAndroid: map[string]int{
  605. "top": 638,
  606. },
  607. model.PlatIPad: map[string]int{
  608. "top": 778,
  609. },
  610. model.PlatIPhoneI: map[string]int{
  611. "top": 979,
  612. },
  613. model.PlatAndroidG: map[string]int{
  614. "top": 1317,
  615. },
  616. model.PlatAndroidI: map[string]int{
  617. "top": 1739,
  618. },
  619. model.PlatIPadI: map[string]int{
  620. "top": 1149,
  621. },
  622. },
  623. "36": map[int8]map[string]int{
  624. model.PlatIPhone: map[string]int{
  625. "top": 475,
  626. },
  627. model.PlatAndroid: map[string]int{
  628. "top": 639,
  629. },
  630. model.PlatIPad: map[string]int{
  631. "top": 779,
  632. },
  633. model.PlatIPhoneI: map[string]int{
  634. "top": 983,
  635. },
  636. model.PlatAndroidG: map[string]int{
  637. "top": 1321,
  638. },
  639. model.PlatAndroidI: map[string]int{
  640. "top": 1706,
  641. },
  642. model.PlatIPadI: map[string]int{
  643. "top": 1153,
  644. },
  645. },
  646. "160": map[int8]map[string]int{
  647. model.PlatIPhone: map[string]int{
  648. "top": 476,
  649. },
  650. model.PlatAndroid: map[string]int{
  651. "top": 640,
  652. },
  653. model.PlatIPad: map[string]int{
  654. "top": 780,
  655. },
  656. model.PlatIPhoneI: map[string]int{
  657. "top": 987,
  658. },
  659. model.PlatAndroidG: map[string]int{
  660. "top": 1325,
  661. },
  662. model.PlatAndroidI: map[string]int{
  663. "top": 1747,
  664. },
  665. model.PlatIPadI: map[string]int{
  666. "top": 1157,
  667. },
  668. },
  669. "119": map[int8]map[string]int{
  670. model.PlatIPhone: map[string]int{
  671. "top": 477,
  672. },
  673. model.PlatAndroid: map[string]int{
  674. "top": 641,
  675. },
  676. model.PlatIPad: map[string]int{
  677. "top": 781,
  678. },
  679. model.PlatIPhoneI: map[string]int{
  680. "top": 992,
  681. },
  682. model.PlatAndroidG: map[string]int{
  683. "top": 1330,
  684. },
  685. model.PlatAndroidI: map[string]int{
  686. "top": 1752,
  687. },
  688. model.PlatIPadI: map[string]int{
  689. "top": 1162,
  690. },
  691. },
  692. "155": map[int8]map[string]int{
  693. model.PlatIPhone: map[string]int{
  694. "top": 478,
  695. },
  696. model.PlatAndroid: map[string]int{
  697. "top": 642,
  698. },
  699. model.PlatIPad: map[string]int{
  700. "top": 782,
  701. },
  702. model.PlatIPhoneI: map[string]int{
  703. "top": 997,
  704. },
  705. model.PlatAndroidG: map[string]int{
  706. "top": 1335,
  707. },
  708. model.PlatAndroidI: map[string]int{
  709. "top": 1757,
  710. },
  711. model.PlatIPadI: map[string]int{
  712. "top": 1167,
  713. },
  714. },
  715. "5": map[int8]map[string]int{
  716. model.PlatIPhone: map[string]int{
  717. "top": 479,
  718. },
  719. model.PlatAndroid: map[string]int{
  720. "top": 643,
  721. },
  722. model.PlatIPad: map[string]int{
  723. "top": 783,
  724. },
  725. model.PlatIPhoneI: map[string]int{
  726. "top": 1001,
  727. },
  728. model.PlatAndroidG: map[string]int{
  729. "top": 1339,
  730. },
  731. model.PlatAndroidI: map[string]int{
  732. "top": 1761,
  733. },
  734. model.PlatIPadI: map[string]int{
  735. "top": 1171,
  736. },
  737. },
  738. "23": map[int8]map[string]int{
  739. model.PlatIPhone: map[string]int{
  740. "top": 480,
  741. },
  742. model.PlatAndroid: map[string]int{
  743. "top": 644,
  744. },
  745. model.PlatIPad: map[string]int{
  746. "top": 784,
  747. },
  748. model.PlatIPhoneI: map[string]int{
  749. "top": 1005,
  750. },
  751. model.PlatAndroidG: map[string]int{
  752. "top": 1343,
  753. },
  754. model.PlatAndroidI: map[string]int{
  755. "top": 1765,
  756. },
  757. model.PlatIPadI: map[string]int{
  758. "top": 1175,
  759. },
  760. },
  761. "11": map[int8]map[string]int{
  762. model.PlatIPhone: map[string]int{
  763. "top": 481,
  764. },
  765. model.PlatAndroid: map[string]int{
  766. "top": 645,
  767. },
  768. model.PlatIPad: map[string]int{
  769. "top": 785,
  770. },
  771. model.PlatIPhoneI: map[string]int{
  772. "top": 1009,
  773. },
  774. model.PlatAndroidG: map[string]int{
  775. "top": 1347,
  776. },
  777. model.PlatAndroidI: map[string]int{
  778. "top": 1769,
  779. },
  780. model.PlatIPadI: map[string]int{
  781. "top": 1179,
  782. },
  783. },
  784. "165": map[int8]map[string]int{
  785. model.PlatIPhone: map[string]int{
  786. "top": 1643,
  787. },
  788. model.PlatAndroid: map[string]int{
  789. "top": 1639,
  790. },
  791. model.PlatIPad: map[string]int{
  792. "top": 1647,
  793. },
  794. model.PlatIPhoneI: map[string]int{
  795. "top": 1643,
  796. },
  797. model.PlatAndroidG: map[string]int{
  798. "top": 1639,
  799. },
  800. model.PlatIPadI: map[string]int{
  801. "top": 1647,
  802. },
  803. },
  804. "167": map[int8]map[string]int{
  805. model.PlatIPhone: map[string]int{
  806. "top": 1950,
  807. },
  808. model.PlatAndroid: map[string]int{
  809. "top": 1952,
  810. },
  811. model.PlatIPad: map[string]int{
  812. "top": 1951,
  813. },
  814. },
  815. "181": map[int8]map[string]int{
  816. model.PlatIPhone: map[string]int{
  817. "top": 2245,
  818. },
  819. model.PlatAndroid: map[string]int{
  820. "top": 2249,
  821. },
  822. model.PlatIPad: map[string]int{
  823. "top": 2253,
  824. },
  825. },
  826. "177": map[int8]map[string]int{
  827. model.PlatIPhone: map[string]int{
  828. "top": 2295,
  829. },
  830. model.PlatAndroid: map[string]int{
  831. "top": 2299,
  832. },
  833. model.PlatIPad: map[string]int{
  834. "top": 2303,
  835. },
  836. },
  837. }
  838. _bannersPlat = map[int8]string{
  839. model.PlatIPhone: "467,482,471,470,472,473,474,475,476,477,478,479,480,481,1643,1950,2245,2295",
  840. model.PlatAndroid: "631,646,635,634,636,637,638,639,640,641,642,643,644,645,1639,1952,2249,2299",
  841. model.PlatIPad: "771,786,775,774,776,777,778,779,780,781,782,783,784,785,1647,1951,2253,2303",
  842. model.PlatIPhoneI: "947,1013,967,962,971,975,979,983,987,992,997,1001,1005,1009,1643",
  843. model.PlatAndroidG: "1285,1351,1305,1300,1309,1313,1317,1321,1325,1330,1335,1339,1343,1347,1639",
  844. model.PlatAndroidI: "1707,1773,1727,1722,1731,1735,1739,1706,1747,1752,1757,1761,1765,1769,1639",
  845. model.PlatIPadI: "1117,1183,1137,1132,1141,1145,1149,1153,1157,1162,1167,1171,1175,1179,1647",
  846. }
  847. )
  848. // getBanners get banners by plat, build channel, ip.
  849. func (s *Service) getBanners(c context.Context, plat int8, build int, module, channel, ip string, resbs map[int][]*resource.Banner, isIndex bool) (res map[string][]*banner.Banner) {
  850. var (
  851. bannerIds = _banners
  852. )
  853. if isIndex {
  854. bannerIds = _bannersIndex
  855. }
  856. res = map[string][]*banner.Banner{}
  857. for pos, bID := range bannerIds[module][plat] {
  858. if rbs, ok := resbs[bID]; ok {
  859. var bs []*banner.Banner
  860. for _, rb := range rbs {
  861. b := &banner.Banner{}
  862. b.ResChangeBanner(rb)
  863. bs = append(bs, b)
  864. }
  865. res[pos] = bs
  866. }
  867. }
  868. return
  869. }
  870. // resBannersplat
  871. func (s *Service) resBanners(c context.Context, plat int8, build int, mid int64, resIDStr, channel, ip, buvid, network, mobiApp, device, adExtra string) (res map[int][]*resource.Banner) {
  872. var (
  873. plm = s.bannerCache[plat] // operater banner
  874. err error
  875. isAd = true
  876. )
  877. if plat == model.PlatAndroid && build <= 430000 {
  878. isAd = false
  879. }
  880. if res, err = s.res.ResBanner(c, plat, build, mid, resIDStr, channel, ip, buvid, network, mobiApp, device, adExtra, isAd); err != nil || len(res) == 0 {
  881. log.Error("s.res.ResBanner is null or err(%v)", err)
  882. res = plm
  883. return
  884. }
  885. return
  886. }