-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv.js
68 lines (62 loc) · 2 KB
/
v.js
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// //------------------------------------- image Schema ---------------------------------------//
// const imageSchema = new mongoose.Schema({
// data: Buffer,
// contentType: String,
// required: false,
// })
// //------------------------------------- file Schema ---------------------------------------//
// const fileSchema = new mongoose.Schema({
// originalFileName: { type: String },
// serverFileName: { type: String },
// size: { type: Number },
// // uploadedBy: {
// // type: mongoose.Schema.Types.ObjectId,
// // ref: "user",
// // required: true,
// // },
// postId: { type: mongoose.Schema.Types.ObjectId, ref: "post" },
// isDeleted: { type: Boolean, default: false },
// required: false,
// })
// const img = req.body.image //수정필요
// ? {
// data: fs.readFileSync(
// path.join(__dirname + "/uploads/" + req.files.image[0].originalname)
// ),
// contentType: "image/png",
// }
// : undefined
// const file = req.body.file //수정필요
// ? {
// originalFileName: req.files.file[0].originalname,
// serverFileName: req.files.file[0].filename,
// size: req.files.file[0].size,
// // uploadedBy: {
// // type: mongoose.Schema.Types.ObjectId,
// // ref: "user",
// // required: true,
// // },
// postId: req.body._id,
// }
// : undefined
// const img = req.body.image
// ? {
// data: fs.readFileSync(
// path.join(__dirname + "/uploads/" + req.files.image[0].originalname)
// ),
// contentType: "image/png",
// }
// : undefined
// const file = req.body.file
// ? {
// originalFileName: req.files.file[0].originalname,
// serverFileName: req.files.file[0].filename,
// size: req.files.file[0].size,
// // uploadedBy: {
// // type: mongoose.Schema.Types.ObjectId,
// // ref: "user",
// // required: true,
// // },
// postId: req.body._id,
// }
// : undefined