Toggle navigation
Toggle navigation
This project
Loading...
Sign in
백승욱
/
movie-reco-chatbot
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-07 21:05:26 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1ac890754d7c0d4acd1978f7f4fc7187ba3ccac2
1ac89075
1 parent
72507e9f
Refactoring 1.0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
8 deletions
features/Exception.js
features/MovieInfo.js
features/MovieList.js
main.js
features/Exception.js
View file @
1ac8907
...
...
@@ -28,7 +28,7 @@ exports.SayIDontKnow = function (replyToken) {
});
}
exports
.
test_1
=
function
(
replyToken
)
{
exports
.
ShowGenre
=
function
(
replyToken
)
{
request
.
post
(
{
url
:
LINE_URL
+
'/reply'
,
...
...
@@ -40,7 +40,8 @@ exports.test_1 = function (replyToken) {
"messages"
:
[
{
"type"
:
"text"
,
"text"
:
"영화 장르를 선택해주세요."
"text"
:
"다음 영화 장르 중 하나를 선택해주세요.\n"
+
"드라마 / 코미디 / 액션 / 멜로/로맨스 / 스릴러 / 미스터리 / 공포(호러) / 어드벤처 / 범죄 / 가족 / 판타지 / SF / 사극 / 애니메이션 / 다큐멘터리 / 전쟁 / 뮤지컬 / 기타"
}
]
}
...
...
@@ -49,7 +50,7 @@ exports.test_1 = function (replyToken) {
});
}
exports
.
test_2
=
function
(
replyToken
)
{
exports
.
ShowSearch
=
function
(
replyToken
)
{
request
.
post
(
{
url
:
LINE_URL
+
'/reply'
,
...
...
features/MovieInfo.js
View file @
1ac8907
...
...
@@ -44,7 +44,7 @@ exports.MovieInfo = function(replyToken, message) {
"messages"
:[
{
"type"
:
"text"
,
"text"
:
`
영화명:
${
MovieName
}
\n개봉날짜:
${
MovieDate
}
\n상영시간:
${
MovieTime
}
분\n장르:
${
MovieGenres
}
\n감독:
${
MovieDirec
}
\n출연배우
:
${
MovieActors
}
`
"text"
:
`
[영화명]:
${
MovieName
}
\n[개봉날짜]:
${
MovieDate
}
\n[상영시간]:
${
MovieTime
}
분\n[장르]:
${
MovieGenres
}
\n[감독]:
${
MovieDirec
}
\n[출연배우]
:
${
MovieActors
}
`
}
]
}
...
...
features/MovieList.js
View file @
1ac8907
...
...
@@ -27,7 +27,7 @@ exports.movielist = function (replyToken, message) {
else
{
directors
=
body
.
movieListResult
.
movieList
[
i
].
directors
[
0
].
peopleNm
;
}
result
+=
'제목: '
+
movieNm
+
`(
${
prdtYear
}
)`
+
'\n'
+
'감독: '
+
directors
+
'\n'
+
'영화코드: '
+
movieCd
+
'\n'
;
result
+=
'제목: '
+
movieNm
+
`(
${
prdtYear
}
)`
+
'\n'
+
'감독: '
+
directors
+
'\n'
+
'영화코드: '
+
movieCd
+
'\n
\n
'
;
}
request
.
post
(
{
...
...
main.js
View file @
1ac8907
...
...
@@ -39,7 +39,7 @@ function ShowMenu() {
"messages"
:
[
{
"type"
:
"text"
,
"text"
:
"
0번 입력 : 메뉴 출력\n1번 입력 : 최신영화 추천\n2번 입력 : 장르별 영화 추천\n3번 입력
: 영화 검색하기\n**영화코드 입력 : 영화 상세정보 조회"
"text"
:
"
[0번 입력] : 메뉴 출력\n[1번 입력] : 최신영화 추천\n[2번 입력] : 장르별 영화 추천\n[3번 입력]
: 영화 검색하기\n**영화코드 입력 : 영화 상세정보 조회"
}
]
}
...
...
@@ -78,11 +78,11 @@ function Response(replyToken, message) {
}
else
if
((
message
==
'2'
||
message
==
'2번'
)
&&
flag_2
==
0
)
{
flag_2
=
1
;
Exception
.
test_1
(
replyToken
);
Exception
.
ShowGenre
(
replyToken
);
}
else
if
((
message
==
'3'
||
message
==
'3번'
)
&&
flag_3
==
0
)
{
flag_3
=
1
;
Exception
.
test_2
(
replyToken
);
Exception
.
ShowSearch
(
replyToken
);
}
else
if
(
flag_2
==
1
)
{
flag_2
=
0
;
...
...
Please
register
or
login
to post a comment