Banner.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { Model, Collection } from 'js-abstract-model'
  2. class Banner extends Model {
  3. constructor (data) {
  4. super(data, [
  5. { key: 'id' },
  6. { key: 'title' },
  7. { key: 'body' },
  8. { key: 'photo' },
  9. {
  10. key: 'features',
  11. default: {
  12. xl: {
  13. src: '',
  14. width: '',
  15. height: ''
  16. },
  17. lg: {
  18. src: '',
  19. width: '',
  20. height: ''
  21. },
  22. md: {
  23. src: '',
  24. width: '',
  25. height: ''
  26. },
  27. sm: {
  28. src: '',
  29. width: '',
  30. height: ''
  31. },
  32. xs: {
  33. src: '',
  34. width: '',
  35. height: ''
  36. }
  37. }
  38. },
  39. { key: 'link' },
  40. { key: 'order' },
  41. { key: 'ratio' },
  42. { key: 'useAEEEvent' },
  43. {
  44. key: 'AEEEventBody',
  45. default: {
  46. id: '-',
  47. name: '-',
  48. creative: null,
  49. position: null
  50. }
  51. }
  52. ])
  53. }
  54. }
  55. class BannerList extends Collection {
  56. model () {
  57. return Banner
  58. }
  59. }
  60. export { Banner, BannerList }