Showing
1 changed file
with
41 additions
and
0 deletions
| ... | @@ -201,6 +201,47 @@ apiRouter.post('/question11', (req, res) => { | ... | @@ -201,6 +201,47 @@ apiRouter.post('/question11', (req, res) => { |
| 201 | res.status(200).send(responseBody); | 201 | res.status(200).send(responseBody); |
| 202 | }); | 202 | }); |
| 203 | 203 | ||
| 204 | +apiRouter.post('/question12', (req, res) => { | ||
| 205 | + var mesg = req.body.userRequest.utterance; | ||
| 206 | + var userId = req.body.userRequest.user.id; | ||
| 207 | + var mbti = ''; | ||
| 208 | + if (mesg == "네"){ | ||
| 209 | + mbti = 'F'; | ||
| 210 | + } | ||
| 211 | + else if (mesg == "아니오") { | ||
| 212 | + mbti = 'T'; | ||
| 213 | + } | ||
| 214 | + userDB[userId][2] += mbti; | ||
| 215 | + console.log(userDB); | ||
| 216 | + const responseBody = { | ||
| 217 | + version: "2.0", | ||
| 218 | + template: { | ||
| 219 | + outputs: [ | ||
| 220 | + { | ||
| 221 | + simpleText: { | ||
| 222 | + text: '[question12]\n집과 업무 환경이 잘 정돈되어 있습니다.' | ||
| 223 | + } | ||
| 224 | + } | ||
| 225 | + ], | ||
| 226 | + quickReplies: [ | ||
| 227 | + { | ||
| 228 | + action: "block", | ||
| 229 | + label: "네", | ||
| 230 | + message: "네", | ||
| 231 | + blockId: "6297811bf591aa190554a22e" | ||
| 232 | + }, | ||
| 233 | + { | ||
| 234 | + action: "block", | ||
| 235 | + label: "아니오", | ||
| 236 | + message: "아니오", | ||
| 237 | + blockId: "6297811bf591aa190554a22e" | ||
| 238 | + } | ||
| 239 | + ] | ||
| 240 | + } | ||
| 241 | + } | ||
| 242 | + res.status(200).send(responseBody); | ||
| 243 | +}); | ||
| 244 | + | ||
| 204 | app.listen((process.env.PORT || 3000), function() { | 245 | app.listen((process.env.PORT || 3000), function() { |
| 205 | console.log('Example skill server listening on port 3000!'); | 246 | console.log('Example skill server listening on port 3000!'); |
| 206 | }); | 247 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment