import RefLectureRepository = require ( './RefLectureRepository' ) ; import RefLecture from './model/RefLecture' ; import ObjectUtil = require ( '@app/core/common/util/ObjectUtil' ) ; import LectureService = require ( '@app/core/lecture/LectureService' ) ; export function query ( query , limit , offset ) { return RefLectureRepository . query ( query , limit , offset ) ; } export function queryWithCourseTitle ( query , courseTitle , limit , offset ) { return RefLectureRepository . queryWithCourseTitle ( query , courseTitle , limit , offset ) ; } export function getByMongooseId ( mongooseId ) { return RefLectureRepository . findByMongooseId ( mongooseId ) ; } export function getByCourseNumber ( year , semester , courseNumber , lectureNumber ) { return RefLectureRepository . findByCourseNumber ( year , semester , courseNumber , lectureNumber ) ; } export function getBySemester ( year , semester ) { return RefLectureRepository . findBySemester ( year , semester ) ; } export function addAll ( lectures ) { return RefLectureRepository . insertAll ( lectures ) ; } export function removeBySemester ( year , semester ) { return RefLectureRepository . deleteBySemester ( year , semester ) ; } export function remove ( lectureId ) { return RefLectureRepository . deleteByLectureId ( lectureId ) ; } export function partialModifiy ( lectureId , lecture ) { let lectureCopy = ObjectUtil . deepCopy ( lecture ) ; ObjectUtil . deleteObjectId ( lectureCopy ) ; LectureService . setTimemask ( lectureCopy ) ; return RefLectureRepository . partialUpdateRefLecture ( lectureId , lectureCopy ) ; }