박기홍

job db updated

No preview for this file type
...@@ -15,10 +15,6 @@ const jobSchema = new schema({ ...@@ -15,10 +15,6 @@ const jobSchema = new schema({
15 type: String, 15 type: String,
16 default: "대분류를 입력하세요", 16 default: "대분류를 입력하세요",
17 }, 17 },
18 - middle:{
19 - type: String,
20 - default: "중분류를 입력하세요",
21 - },
22 low:{ 18 low:{
23 type: String, 19 type: String,
24 default: "소분류를 입력하세요", 20 default: "소분류를 입력하세요",
......
...@@ -7,7 +7,7 @@ const questionSchema = new schema({ ...@@ -7,7 +7,7 @@ const questionSchema = new schema({
7 * 번호 질문내용 답1 답2 가중치1, 가중치2 7 * 번호 질문내용 답1 답2 가중치1, 가중치2
8 */ 8 */
9 9
10 - questionNum:{ 10 + num:{
11 type: Number, 11 type: Number,
12 default: -1 12 default: -1
13 }, 13 },
...@@ -23,27 +23,27 @@ const questionSchema = new schema({ ...@@ -23,27 +23,27 @@ const questionSchema = new schema({
23 type: String, 23 type: String,
24 default: "아니다" 24 default: "아니다"
25 }, 25 },
26 - fit: { 26 + fight: {
27 type: Number, 27 type: Number,
28 default: 0, 28 default: 0,
29 }, 29 },
30 - dtl: { 30 + detail: {
31 type: Number, 31 type: Number,
32 default: 0, 32 default: 0,
33 }, 33 },
34 - trf: { 34 + traffic: {
35 type: Number, 35 type: Number,
36 default: 0, 36 default: 0,
37 }, 37 },
38 - ctr: { 38 + control: {
39 type: Number, 39 type: Number,
40 default: 0, 40 default: 0,
41 }, 41 },
42 - sup: { 42 + support: {
43 type: Number, 43 type: Number,
44 default: 0, 44 default: 0,
45 }, 45 },
46 - act: { 46 + activity: {
47 type: Number, 47 type: Number,
48 default: 0, 48 default: 0,
49 }, 49 },
......
...@@ -71,15 +71,34 @@ module.exports = function(app) ...@@ -71,15 +71,34 @@ module.exports = function(app)
71 71
72 app.post('/addJobs', async(req, res, next) => { 72 app.post('/addJobs', async(req, res, next) => {
73 // 보직 추가하는 api 73 // 보직 추가하는 api
74 - const datas = req.body;
75 74
76 75
76 +
77 }); 77 });
78 78
79 app.post('/addQuestions', async(req, res, next) => { 79 app.post('/addQuestions', async(req, res, next) => {
80 // 질문 추가하는 api 80 // 질문 추가하는 api
81 - }); 81 + const datas = req.body;
82 + console.log(datas);
83 + console.log(typeof(datas));
82 84
85 + for(let i=0; i<datas.length; i++){
86 + const data = new Question();
83 87
84 - 88 + data.num = datas[i].num;
89 + data.question = datas[i].question;
90 + data.answer1 = datas[i].answer1;
91 + data.answer2 = datas[i].answer2;
92 + data.fight = datas[i].fight;
93 + data.detail = datas[i].detail;
94 + data.traffic = datas[i].traffic;
95 + data.control = datas[i].control;
96 + data.support = datas[i].support;
97 + data.activity = datas[i].activity;
98 +
99 + console.log(data);
100 +
101 + await data.save();
102 + }
103 + });
85 } 104 }
...\ No newline at end of file ...\ No newline at end of file
......