Showing
1 changed file
with
41 additions
and
5 deletions
... | @@ -112,7 +112,6 @@ apiRouter.post('/question16', (req, res) => { | ... | @@ -112,7 +112,6 @@ apiRouter.post('/question16', (req, res) => { |
112 | } else if (mesg == "어떤 기종샀어?") { | 112 | } else if (mesg == "어떤 기종샀어?") { |
113 | mbti = 'T'; | 113 | mbti = 'T'; |
114 | } | 114 | } |
115 | - console.log(mbti); | ||
116 | userDB[userId][2] += mbti; | 115 | userDB[userId][2] += mbti; |
117 | console.log(userDB[userId]); | 116 | console.log(userDB[userId]); |
118 | const responseBody = { | 117 | const responseBody = { |
... | @@ -153,7 +152,6 @@ apiRouter.post('/question17', (req, res) => { | ... | @@ -153,7 +152,6 @@ apiRouter.post('/question17', (req, res) => { |
153 | } else if (mesg == "아니오") { | 152 | } else if (mesg == "아니오") { |
154 | mbti = 'P'; | 153 | mbti = 'P'; |
155 | } | 154 | } |
156 | - console.log(mbti); | ||
157 | userDB[userId][3] += mbti; | 155 | userDB[userId][3] += mbti; |
158 | console.log(userDB[userId]); | 156 | console.log(userDB[userId]); |
159 | const responseBody = { | 157 | const responseBody = { |
... | @@ -194,7 +192,6 @@ apiRouter.post('/question18', (req, res) => { | ... | @@ -194,7 +192,6 @@ apiRouter.post('/question18', (req, res) => { |
194 | } else if (mesg == "아니오") { | 192 | } else if (mesg == "아니오") { |
195 | mbti = 'E'; | 193 | mbti = 'E'; |
196 | } | 194 | } |
197 | - console.log(mbti); | ||
198 | userDB[userId][0] += mbti; | 195 | userDB[userId][0] += mbti; |
199 | console.log(userDB[userId]); | 196 | console.log(userDB[userId]); |
200 | const responseBody = { | 197 | const responseBody = { |
... | @@ -235,7 +232,6 @@ apiRouter.post('/question19', (req, res) => { | ... | @@ -235,7 +232,6 @@ apiRouter.post('/question19', (req, res) => { |
235 | } else if (mesg == "아니오") { | 232 | } else if (mesg == "아니오") { |
236 | mbti = 'S'; | 233 | mbti = 'S'; |
237 | } | 234 | } |
238 | - console.log(mbti); | ||
239 | userDB[userId][1] += mbti; | 235 | userDB[userId][1] += mbti; |
240 | console.log(userDB[userId]); | 236 | console.log(userDB[userId]); |
241 | const responseBody = { | 237 | const responseBody = { |
... | @@ -267,6 +263,45 @@ apiRouter.post('/question19', (req, res) => { | ... | @@ -267,6 +263,45 @@ apiRouter.post('/question19', (req, res) => { |
267 | res.status(200).send(responseBody); | 263 | res.status(200).send(responseBody); |
268 | }); | 264 | }); |
269 | 265 | ||
266 | +apiRouter.post('/question20', (req, res) => { | ||
267 | + var userId = req.body.userRequest.user.id; | ||
268 | + var mesg = req.body.userRequest.utterance; | ||
269 | + var mbti = ''; | ||
270 | + if (mesg == "요즘 취업 어렵지 힘들겠다ㅠㅠ") { | ||
271 | + mbti = 'F'; | ||
272 | + } else if (mesg == "무슨 준비하고있어? 이력서는 넣어봤어?") { | ||
273 | + mbti = 'T'; | ||
274 | + } | ||
275 | + userDB[userId][2] += mbti; | ||
276 | + console.log(userDB[userId]); | ||
277 | + const responseBody = { | ||
278 | + version: "2.0", | ||
279 | + template: { | ||
280 | + outputs: [ | ||
281 | + { | ||
282 | + simpleText: { | ||
283 | + text: '[Question 20/20]\n마지막 여행지를 향해 가던 중 흥미로운 장소를 발견했을 때, 남은 일정을 고려하는 편이다.' | ||
284 | + } | ||
285 | + } | ||
286 | + ], | ||
287 | + quickReplies: [ | ||
288 | + { | ||
289 | + action: "block", | ||
290 | + label: "네", | ||
291 | + message: "네", | ||
292 | + blockId: "6293885b7bd2fd4333583df0" | ||
293 | + }, | ||
294 | + { | ||
295 | + action: "block", | ||
296 | + label: "아니오", | ||
297 | + message: "아니오", | ||
298 | + blockId: "6293885b7bd2fd4333583df0" | ||
299 | + } | ||
300 | + ] | ||
301 | + } | ||
302 | + } | ||
303 | + res.status(200).send(responseBody); | ||
304 | +}); | ||
270 | 305 | ||
271 | apiRouter.post('/result', (req, res) => { | 306 | apiRouter.post('/result', (req, res) => { |
272 | var userId = req.body.userRequest.user.id; | 307 | var userId = req.body.userRequest.user.id; |
... | @@ -278,7 +313,8 @@ apiRouter.post('/result', (req, res) => { | ... | @@ -278,7 +313,8 @@ apiRouter.post('/result', (req, res) => { |
278 | } else if (mesg == "아니오") { | 313 | } else if (mesg == "아니오") { |
279 | mbti = 'P'; | 314 | mbti = 'P'; |
280 | } | 315 | } |
281 | - | 316 | + userDB[userId][3] += mbti; |
317 | + console.log(userDB[userId]); | ||
282 | const responseBody = { | 318 | const responseBody = { |
283 | version: "2.0", | 319 | version: "2.0", |
284 | template: { | 320 | template: { | ... | ... |
-
Please register or login to post a comment