-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlecture.js
More file actions
53 lines (52 loc) · 1.39 KB
/
lecture.js
File metadata and controls
53 lines (52 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const mongoose = require("mongoose");
const { Schema } = mongoose;
const lectureSchema = new Schema(
{
title: { type: String, maxlength: 68 },
description: { type: String },
isActive: Boolean,
sectionId: { type: Schema.Types.ObjectId, ref: "section" },
type: { type: String, default: 'lecture' },
lectureVideo: new Schema(
{
videoPath: { type: String, required: true },
duration: { type: Schema.Types.Number },
thumbnilPath: { type: String, required: true },
captions: [
new Schema({
language: {
type: String,
required: true,
},
path: { type: String, required: true },
}),
],
menifestFile:{ type: String, required: true },
thumbnils:[
{ type: String, required: true }
]
},
{ timestamps: true }
),
lectureArtical: new Schema(
{
text: { type: String, required: true },
isHtml: Boolean,
},
{ timestamps: true }
),
resource: new Schema(
{
url: String,
title: { type: String, maxlength: 100 },
isExternal: Boolean,
fromLib: Boolean,
fromFile: Boolean,
},
{ timestamps: true }
),
},
{ timestamps: true }
);
const lecture = mongoose.model("lecture", lectureSchema);
module.exports = { lecture, lectureSchema };