Minkyung Ko

Add question13

...@@ -242,6 +242,47 @@ apiRouter.post('/question12', (req, res) => { ...@@ -242,6 +242,47 @@ apiRouter.post('/question12', (req, res) => {
242 res.status(200).send(responseBody); 242 res.status(200).send(responseBody);
243 }); 243 });
244 244
245 +apiRouter.post('/question13', (req, res) => {
246 + var mesg = req.body.userRequest.utterance;
247 + var userId = req.body.userRequest.user.id;
248 + var mbti = '';
249 + if (mesg == "네"){
250 + mbti = 'J';
251 + }
252 + else if (mesg == "아니오") {
253 + mbti = 'P';
254 + }
255 + userDB[userId][3] += mbti;
256 + console.log(userDB);
257 + const responseBody = {
258 + version: "2.0",
259 + template: {
260 + outputs: [
261 + {
262 + simpleText: {
263 + text: '[question13]\n친구 관계가 좁고 깊은 편입니다.'
264 + }
265 + }
266 + ],
267 + quickReplies: [
268 + {
269 + action: "block",
270 + label: "네",
271 + message: "네",
272 + blockId: "62978127ab89e678ee86b2e2"
273 + },
274 + {
275 + action: "block",
276 + label: "아니오",
277 + message: "아니오",
278 + blockId: "62978127ab89e678ee86b2e2"
279 + }
280 + ]
281 + }
282 + }
283 + res.status(200).send(responseBody);
284 +});
285 +
245 app.listen((process.env.PORT || 3000), function() { 286 app.listen((process.env.PORT || 3000), function() {
246 console.log('Example skill server listening on port 3000!'); 287 console.log('Example skill server listening on port 3000!');
247 }); 288 });
...\ No newline at end of file ...\ No newline at end of file
......