ContentTopic.js 965 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { Content } from 'src/models/Content.js'
  2. import { Collection, Model } from 'js-abstract-model'
  3. import { ContentHashtagList } from 'src/models/ContentHashtag.js'
  4. import { ContentTopicCategory } from 'src/models/ContentTopicCategory.js'
  5. class ContentTopic extends Model {
  6. constructor (data) {
  7. super(data, [
  8. { key: 'id' },
  9. { key: 'title' },
  10. { key: 'text' },
  11. { key: 'thumbnail' },
  12. { key: 'content' },
  13. {
  14. key: 'content_info',
  15. relatedModel: Content
  16. },
  17. { key: 'category' },
  18. {
  19. key: 'category_info',
  20. relatedModel: ContentTopicCategory
  21. },
  22. { key: 'hashtags' },
  23. {
  24. key: 'hashtags_info',
  25. relatedModel: ContentHashtagList
  26. },
  27. { key: 'creation_time' },
  28. { key: 'last_modification_time' }
  29. ])
  30. }
  31. }
  32. class ContentTopicList extends Collection {
  33. model () {
  34. return ContentTopic
  35. }
  36. }
  37. export { ContentTopic, ContentTopicList }