Minkyung Ko

Add question14

...@@ -283,6 +283,47 @@ apiRouter.post('/question13', (req, res) => { ...@@ -283,6 +283,47 @@ apiRouter.post('/question13', (req, res) => {
283 res.status(200).send(responseBody); 283 res.status(200).send(responseBody);
284 }); 284 });
285 285
286 +apiRouter.post('/question14', (req, res) => {
287 + var mesg = req.body.userRequest.utterance;
288 + var userId = req.body.userRequest.user.id;
289 + var mbti = '';
290 + if (mesg == "네"){
291 + mbti = 'I';
292 + }
293 + else if (mesg == "아니오") {
294 + mbti = 'E';
295 + }
296 + userDB[userId][0] += mbti;
297 + console.log(userDB);
298 + const responseBody = {
299 + version: "2.0",
300 + template: {
301 + outputs: [
302 + {
303 + simpleText: {
304 + text: '[question14]\n공부하기 싫을 때 공부는 왜 해야 하는 것인지 고민에 빠질 때가 있습니다.'
305 + }
306 + }
307 + ],
308 + quickReplies: [
309 + {
310 + action: "block",
311 + label: "네",
312 + message: "네",
313 + blockId: "62979c9ce7a0253c7662ccd4"
314 + },
315 + {
316 + action: "block",
317 + label: "아니오",
318 + message: "아니오",
319 + blockId: "62979c9ce7a0253c7662ccd4"
320 + }
321 + ]
322 + }
323 + }
324 + res.status(200).send(responseBody);
325 +});
326 +
286 app.listen((process.env.PORT || 3000), function() { 327 app.listen((process.env.PORT || 3000), function() {
287 console.log('Example skill server listening on port 3000!'); 328 console.log('Example skill server listening on port 3000!');
288 }); 329 });
...\ No newline at end of file ...\ No newline at end of file
......