Toggle navigation
Toggle navigation
This project
Loading...
Sign in
공정훈
/
find_mbti_bot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
공정훈
2022-06-01 22:27:00 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3f242171cfb4ffd73d59ef759416c66ff975ae76
3f242171
1 parent
0f12f83e
Fix add mbti
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
app/app.js
app/app.js
View file @
3f24217
...
...
@@ -73,8 +73,7 @@ apiRouter.post('/test', (req, res) => {
apiRouter
.
post
(
'/question15'
,
(
req
,
res
)
=>
{
var
userId
=
req
.
body
.
userRequest
.
user
.
id
;
var
mesg
=
req
.
body
.
userRequest
;
userDB
[
userId
]
=
[
''
,
''
,
''
,
''
,
''
];
//new Array(5);
userDB
[
userId
]
=
[
''
,
''
,
''
,
''
,
''
];
const
responseBody
=
{
version
:
"2.0"
,
template
:
{
...
...
@@ -106,13 +105,16 @@ apiRouter.post('/question15', (req, res) => {
apiRouter
.
post
(
'/question16'
,
(
req
,
res
)
=>
{
var
userId
=
req
.
body
.
userRequest
.
user
.
id
;
var
mesg
=
req
.
body
.
userRequest
;
var
mesg
=
req
.
body
.
userRequest
.
utterance
;
var
mbti
=
''
;
if
(
mesg
==
"왜ㅠㅠ무슨일 있었어?"
)
{
mbti
=
'F'
;
}
else
if
(
mesg
==
"어떤 기종샀어?"
)
{
mbti
=
'T'
;
}
console
.
log
(
mbti
);
userDB
[
userId
][
2
]
+=
mbti
;
console
.
log
(
userDB
[
userId
]);
const
responseBody
=
{
version
:
"2.0"
,
template
:
{
...
...
@@ -144,13 +146,16 @@ apiRouter.post('/question16', (req, res) => {
apiRouter
.
post
(
'/question17'
,
(
req
,
res
)
=>
{
var
userId
=
req
.
body
.
userRequest
.
user
.
id
;
var
mesg
=
req
.
body
.
userRequest
;
var
mesg
=
req
.
body
.
userRequest
.
utterance
;
var
mbti
=
''
;
if
(
mesg
==
"네"
)
{
mbti
=
'J'
;
}
else
if
(
mesg
==
"아니오"
)
{
mbti
=
'P'
;
}
console
.
log
(
mbti
);
userDB
[
userId
][
3
]
+=
mbti
;
console
.
log
(
userDB
[
userId
]);
const
responseBody
=
{
version
:
"2.0"
,
template
:
{
...
...
@@ -182,13 +187,16 @@ apiRouter.post('/question17', (req, res) => {
apiRouter
.
post
(
'/question18'
,
(
req
,
res
)
=>
{
var
userId
=
req
.
body
.
userRequest
.
user
.
id
;
var
mesg
=
req
.
body
.
userRequest
;
var
mesg
=
req
.
body
.
userRequest
.
utterance
;
var
mbti
=
''
;
if
(
mesg
==
"네"
)
{
mbti
=
'I'
;
}
else
if
(
mesg
==
"아니오"
)
{
mbti
=
'E'
;
}
console
.
log
(
mbti
);
userDB
[
userId
][
0
]
+=
mbti
;
console
.
log
(
userDB
[
userId
]);
const
responseBody
=
{
version
:
"2.0"
,
template
:
{
...
...
@@ -220,13 +228,16 @@ apiRouter.post('/question18', (req, res) => {
apiRouter
.
post
(
'/question19'
,
(
req
,
res
)
=>
{
var
userId
=
req
.
body
.
userRequest
.
user
.
id
;
var
mesg
=
req
.
body
.
userRequest
;
var
mesg
=
req
.
body
.
userRequest
.
utterance
;
var
mbti
=
''
;
if
(
mesg
==
"네"
)
{
mbti
=
'N'
;
}
else
if
(
mesg
==
"아니오"
)
{
mbti
=
'S'
;
}
console
.
log
(
mbti
);
userDB
[
userId
][
1
]
+=
mbti
;
console
.
log
(
userDB
[
userId
]);
const
responseBody
=
{
version
:
"2.0"
,
template
:
{
...
...
@@ -256,6 +267,7 @@ apiRouter.post('/question19', (req, res) => {
res
.
status
(
200
).
send
(
responseBody
);
});
apiRouter
.
post
(
'/result'
,
(
req
,
res
)
=>
{
var
userId
=
req
.
body
.
userRequest
.
user
.
id
;
var
mesg
=
req
.
body
.
userRequest
.
utterance
;
...
...
@@ -266,8 +278,7 @@ apiRouter.post('/result', (req, res) => {
}
else
if
(
mesg
==
"아니오"
)
{
mbti
=
'P'
;
}
userDB
[
userId
]
+=
mbti
;
console
.
log
(
userDB
[
userId
]);
const
responseBody
=
{
version
:
"2.0"
,
template
:
{
...
...
Please
register
or
login
to post a comment