Showing
1 changed file
with
41 additions
and
0 deletions
... | @@ -119,6 +119,47 @@ apiRouter.post('/question9', (req, res) => { | ... | @@ -119,6 +119,47 @@ apiRouter.post('/question9', (req, res) => { |
119 | res.status(200).send(responseBody); | 119 | res.status(200).send(responseBody); |
120 | }); | 120 | }); |
121 | 121 | ||
122 | +apiRouter.post('/question10', (req, res) => { | ||
123 | + var mesg = req.body.userRequest.utterance; | ||
124 | + var userId = req.body.userRequest.user.id; | ||
125 | + var mbti = ''; | ||
126 | + if (mesg == "네"){ | ||
127 | + mbti = 'I'; | ||
128 | + } | ||
129 | + else if (mesg == "아니오") { | ||
130 | + mbti = 'E'; | ||
131 | + } | ||
132 | + userDB[userId][0] += mbti; | ||
133 | + console.log(userDB); | ||
134 | + const responseBody = { | ||
135 | + version: "2.0", | ||
136 | + template: { | ||
137 | + outputs: [ | ||
138 | + { | ||
139 | + simpleText: { | ||
140 | + text: '[question10]\n본인이 창의적이기보다 현실적인 사람이라고 생각합니다.' | ||
141 | + } | ||
142 | + } | ||
143 | + ], | ||
144 | + quickReplies: [ | ||
145 | + { | ||
146 | + action: "block", | ||
147 | + label: "네", | ||
148 | + message: "네", | ||
149 | + blockId: "629781015ceed96c385449c8" | ||
150 | + }, | ||
151 | + { | ||
152 | + action: "block", | ||
153 | + label: "아니오", | ||
154 | + message: "아니오", | ||
155 | + blockId: "629781015ceed96c385449c8" | ||
156 | + } | ||
157 | + ] | ||
158 | + } | ||
159 | + } | ||
160 | + res.status(200).send(responseBody); | ||
161 | +}); | ||
162 | + | ||
122 | app.listen((process.env.PORT || 3000), function() { | 163 | app.listen((process.env.PORT || 3000), function() { |
123 | console.log('Example skill server listening on port 3000!'); | 164 | console.log('Example skill server listening on port 3000!'); |
124 | }); | 165 | }); |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment