Showing
5 changed files
with
33 additions
and
4 deletions
.gitignore
0 → 100644
... | @@ -3,6 +3,10 @@ const mongoose = require("mongoose"); | ... | @@ -3,6 +3,10 @@ const mongoose = require("mongoose"); |
3 | const { range } = require("express/lib/request"); | 3 | const { range } = require("express/lib/request"); |
4 | const xlsx = require("xlsx"); | 4 | const xlsx = require("xlsx"); |
5 | 5 | ||
6 | +fs.readdirSync(testFolder).forEach(file => { | ||
7 | + console.log(file); | ||
8 | +}); | ||
9 | + | ||
6 | const excelFile = xlsx.readFile("./GuideLine/컴퓨터공학과 권장이수 가이드라인.xlsx"); | 10 | const excelFile = xlsx.readFile("./GuideLine/컴퓨터공학과 권장이수 가이드라인.xlsx"); |
7 | 11 | ||
8 | const sheetName = excelFile.SheetNames[0]; | 12 | const sheetName = excelFile.SheetNames[0]; |
... | @@ -30,7 +34,7 @@ function jason_to_arry() { | ... | @@ -30,7 +34,7 @@ function jason_to_arry() { |
30 | fourth_second.push(jsonData[data]['4학년 2학기']); | 34 | fourth_second.push(jsonData[data]['4학년 2학기']); |
31 | } | 35 | } |
32 | } | 36 | } |
33 | -// jason -> array로 변경 | 37 | +// json -> array로 변경 |
34 | function remove_null() { | 38 | function remove_null() { |
35 | first_first = first_first.filter(function (item) { | 39 | first_first = first_first.filter(function (item) { |
36 | return item !== null && item !== undefined && item !== ''; | 40 | return item !== null && item !== undefined && item !== ''; |
... | @@ -66,7 +70,6 @@ function remove_null() { | ... | @@ -66,7 +70,6 @@ function remove_null() { |
66 | new_list.push(fourth_second); | 70 | new_list.push(fourth_second); |
67 | } | 71 | } |
68 | // null 값 제거 | 72 | // null 값 제거 |
69 | - | ||
70 | jason_to_arry() | 73 | jason_to_arry() |
71 | remove_null() | 74 | remove_null() |
72 | 75 | ||
... | @@ -83,8 +86,6 @@ const connect = mongoose.connect(config.url, | ... | @@ -83,8 +86,6 @@ const connect = mongoose.connect(config.url, |
83 | var express = require('express'); | 86 | var express = require('express'); |
84 | 87 | ||
85 | var major_list = ["A07337", "A10628", "A07308", "A10627"]; | 88 | var major_list = ["A07337", "A10628", "A07308", "A10627"]; |
86 | - | ||
87 | - | ||
88 | const { Subinfo } = require('./models/model'); | 89 | const { Subinfo } = require('./models/model'); |
89 | var request = require('request'); | 90 | var request = require('request'); |
90 | for (i in major_list) { | 91 | for (i in major_list) { | ... | ... |
models/model.js
0 → 100644
1 | +const mongoose = require("mongoose"); | ||
2 | + | ||
3 | + const TimeSchema = new mongoose.Schema({ | ||
4 | + time: String, | ||
5 | + prof: String, | ||
6 | + }); | ||
7 | + | ||
8 | + const SubSchema = new mongoose.Schema({ | ||
9 | + campus: String, | ||
10 | + college: String, | ||
11 | + department: String, | ||
12 | + grade: String, | ||
13 | + name: String, | ||
14 | + credit: String, | ||
15 | + choice: String, | ||
16 | + subject: [TimeSchema] | ||
17 | + }); | ||
18 | + | ||
19 | + const Subinfo = mongoose.model('Subinfo', SubSchema); | ||
20 | + module.exports = {Subinfo}; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
package-lock.json
0 → 100644
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment