Minkyung Ko

Add question11

...@@ -22,7 +22,7 @@ apiRouter.post('/test', (req, res) => { ...@@ -22,7 +22,7 @@ apiRouter.post('/test', (req, res) => {
22 outputs: [ 22 outputs: [
23 { 23 {
24 simpleText: { 24 simpleText: {
25 - text: 'MBTI 테스트 question8-14' 25 + text: 'MBTI 테스트 question8-14\n시작하려면 시작하기 버튼을 눌러주세요!'
26 } 26 }
27 } 27 }
28 ], 28 ],
...@@ -160,6 +160,47 @@ apiRouter.post('/question10', (req, res) => { ...@@ -160,6 +160,47 @@ apiRouter.post('/question10', (req, res) => {
160 res.status(200).send(responseBody); 160 res.status(200).send(responseBody);
161 }); 161 });
162 162
163 +apiRouter.post('/question11', (req, res) => {
164 + var mesg = req.body.userRequest.utterance;
165 + var userId = req.body.userRequest.user.id;
166 + var mbti = '';
167 + if (mesg == "네"){
168 + mbti = 'S';
169 + }
170 + else if (mesg == "아니오") {
171 + mbti = 'N';
172 + }
173 + userDB[userId][1] += mbti;
174 + console.log(userDB);
175 + const responseBody = {
176 + version: "2.0",
177 + template: {
178 + outputs: [
179 + {
180 + simpleText: {
181 + text: '[question11]\n팀플을 하는 경우, 충실하지만 실적을 못 내는 팀원을 제명하기 어려워합니다.'
182 + }
183 + }
184 + ],
185 + quickReplies: [
186 + {
187 + action: "block",
188 + label: "네",
189 + message: "네",
190 + blockId: "6297810fe7a0253c7662cca8"
191 + },
192 + {
193 + action: "block",
194 + label: "아니오",
195 + message: "아니오",
196 + blockId: "6297810fe7a0253c7662cca8"
197 + }
198 + ]
199 + }
200 + }
201 + res.status(200).send(responseBody);
202 +});
203 +
163 app.listen((process.env.PORT || 3000), function() { 204 app.listen((process.env.PORT || 3000), function() {
164 console.log('Example skill server listening on port 3000!'); 205 console.log('Example skill server listening on port 3000!');
165 }); 206 });
...\ No newline at end of file ...\ No newline at end of file
......