Session.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { Model, Collection } from 'js-abstract-model'
  2. import { User } from 'src/models/User'
  3. class Session extends Model {
  4. constructor (data) {
  5. super(data, [
  6. { key: 'id' },
  7. { key: 'creator' },
  8. {
  9. key: 'creator_info',
  10. relatedModel: User
  11. },
  12. { key: 'classroom' },
  13. { key: 'title' },
  14. { key: 'syllabus' },
  15. { key: 'description' },
  16. { key: 'beginning_time' },
  17. { key: 'ending_time' },
  18. { key: 'questions' },
  19. { key: 'questions_info' },
  20. { key: 'creation_time' },
  21. { key: 'last_modification_time' },
  22. { key: 'is_defined_syllabus' },
  23. { key: 'is_show_answer_input' },
  24. { key: 'is_show_syllabus_input' },
  25. { key: 'is_show_present_listen_input' },
  26. { key: 'is_enabled_answering' },
  27. { key: 'is_enabled_changing_attendance_status' },
  28. { key: 'current_user_attendance_sheet' },
  29. { key: 'assignment_description' },
  30. {
  31. key: 'session_attendance_sheets',
  32. defalut: []
  33. }
  34. ])
  35. }
  36. }
  37. class SessionList extends Collection {
  38. model () {
  39. return Session
  40. }
  41. }
  42. export { Session, SessionList }