Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이종규
/
chatbot_project
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
JKL
2021-12-03 14:30:27 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8046e73d7cfd39bb7630b8941a1f93beaf9fffba
8046e73d
1 parent
ca4a88fe
Modularization
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
188 additions
and
135 deletions
app.js
club.js
haksa.js
haksik.js
app.js
View file @
8046e73
...
...
@@ -9,6 +9,10 @@ const app = express();
app
.
use
(
express
.
urlencoded
({
extended
:
false
}));
app
.
use
(
express
.
json
());
var
club
=
require
(
'./club'
);
var
haksik
=
require
(
'./haksik'
);
var
haksa
=
require
(
'./haksa'
);
app
.
post
(
'/message'
,
(
req
,
res
)
=>
{
const
question
=
req
.
body
.
userRequest
.
utterance
;
const
goMain
=
'처음으로'
;
...
...
@@ -16,150 +20,20 @@ app.post('/message', (req, res) => {
// 학사정보 간편보기
if
(
question
==
"간편하게 보는 학사정보"
){
data
=
{
"version"
:
"2.0"
,
"template"
:
{
"outputs"
:
[
{
"listCard"
:
{
"header"
:
{
"title"
:
"KHU 학사정보 알리미"
},
"items"
:
[
{
"title"
:
"장학금 공지사항"
,
"description"
:
"챗봇으로 손쉽게 알아보는 학사정보"
,
"imageUrl"
:
"https://mblogthumb-phinf.pstatic.net/20140716_293/envicontest_1405437648963lV4y4_GIF/University_Seal.gif?type=w2"
,
"link"
:
{
"web"
:
"https://www.khu.ac.kr/kor/notice/list.do?category=SCHOLARSHIP&page=1"
}
},
{
"title"
:
"공용 소프트웨어 필요할 땐?"
,
"description"
:
"경희대학교 정보처를 이용해보세요."
,
"imageUrl"
:
"https://cdn-icons.flaticon.com/png/128/2888/premium/2888407.png?token=exp=1638455259~hmac=d58c655e0ac8a16809b48323ea83a75f"
,
"link"
:
{
"web"
:
"https://ois.khu.ac.kr/index.do?sso=ok"
}
},
{
"title"
:
"학사 공지사항"
,
"description"
:
"학사 일정 공지사항 알아보기"
,
"imageUrl"
:
"https://cdn-icons.flaticon.com/png/128/3277/premium/3277431.png?token=exp=1638455425~hmac=4fe1afa937ad2ca62e17e25a34aa342e"
,
"link"
:
{
"web"
:
"https://www.khu.ac.kr/kor/notice/list.do?category=UNDERGRADUATE&page=1"
}
}
],
"buttons"
:
[
{
"label"
:
"홈페이지 구경가기"
,
"action"
:
"webLink"
,
"webLinkUrl"
:
"https://www.khu.ac.kr/kor/main/index.do"
}
]
}
}
]
}
}
data
=
haksa
.
Haksa_Information
(
data
);
}
//동아리 정보 보기
if
(
question
==
"바운스"
||
question
==
"bounce"
){
data
=
{
"version"
:
"2.0"
,
"template"
:
{
"outputs"
:
[
{
"listCard"
:
{
"header"
:
{
"title"
:
"BOUNCE"
},
"items"
:
[
{
"title"
:
"Instagram"
,
"description"
:
"인스타그램으로 이동"
,
"imageUrl"
:
"https://cdn-icons.flaticon.com/png/128/3955/premium/3955024.png?token=exp=1638459829~hmac=5fedfb0e259d3541fa15144c8329704c"
,
"link"
:
{
"web"
:
"https://www.instagram.com/official_bnc/"
}
},
{
"title"
:
"Facebook"
,
"description"
:
"페이스북으로 이동"
,
"imageUrl"
:
"https://cdn-icons-png.flaticon.com/128/145/145802.png"
,
"link"
:
{
"web"
:
"https://m.facebook.com/khubounce"
}
},
{
"title"
:
"Youtube"
,
"description"
:
"유튜브로 이동"
,
"imageUrl"
:
"https://cdn-icons-png.flaticon.com/128/187/187209.png"
,
"link"
:
{
"web"
:
"https://m.youtube.com/channel/UCdqjjUiX3nTsr0neeC1ovvw"
}
}
]
}
}
]
}
}
data
=
club
.
Bounce
(
data
);
}
//학식
if
(
question
==
"서울캠퍼스"
)
{
data
=
{
'version'
:
'2.0'
,
'template'
:
{
'outputs'
:
[{
'simpleImage'
:
{
'imageUrl'
:
"https://coop.khu.ac.kr/wp-content/uploads/2021/11/20211129-1301x2048.png"
,
'altText'
:
"서울캠퍼스 식단입니다."
}
}],
'quickReplies'
:
[{
'label'
:
goMain
,
'action'
:
'message'
,
'messageText'
:
goMain
}]
}
}
data
=
haksik
.
Seoul
(
data
);
}
else
if
(
question
==
"국제캠퍼스"
)
{
data
=
{
"version"
:
"2.0"
,
"template"
:
{
"outputs"
:
[
{
"basicCard"
:
{
"title"
:
"국제캠퍼스 학식"
,
"description"
:
"오늘의 학식은 무엇일까?!"
,
"thumbnail"
:
{
"imageUrl"
:
"https://ww.namu.la/s/e38da99cb3bbad5d4a7f19a015fc2a888e01a7c996bb18465f8ba242a21ac5b3d1f2f977094552b00c706aab9c5c7e48dedae0103ed84d8039376458bebeaf0c43c7642b2544a52a016d0633eeab043924071315d41e15ef8df134009508ec03"
},
"profile"
:
{
"imageUrl"
:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT4BJ9LU4Ikr_EvZLmijfcjzQKMRCJ2bO3A8SVKNuQ78zu2KOqM"
,
"nickname"
:
"학식"
},
"social"
:
{
"like"
:
1238
,
"comment"
:
8
,
"share"
:
780
},
"buttons"
:
[
{
"action"
:
"webLink"
,
"label"
:
"학식보기"
,
"webLinkUrl"
:
"https://www.khu.ac.kr/kor/forum/list.do?type=RESTAURANT&category=INTL&page=1"
}
]
}
}
]
}
}
data
=
haksik
.
Global
(
data
);
}
res
.
json
(
data
);
});
...
...
club.js
0 → 100644
View file @
8046e73
const
express
=
require
(
'express'
);
const
app
=
express
();
app
.
use
(
express
.
urlencoded
({
extended
:
false
}));
app
.
use
(
express
.
json
());
var
club_data
;
//동아리 정보 보기
module
.
exports
.
Bounce
=
function
(
club_data
){
club_data
=
{
"version"
:
"2.0"
,
"template"
:
{
"outputs"
:
[
{
"listCard"
:
{
"header"
:
{
"title"
:
"BOUNCE"
},
"items"
:
[
{
"title"
:
"Instagram"
,
"description"
:
"인스타그램으로 이동"
,
"imageUrl"
:
"https://cdn-icons.flaticon.com/png/128/4494/premium/4494488.png?token=exp=1638510204~hmac=e5de773ad3fee42dd34e247d2c695246"
,
"link"
:
{
"web"
:
"https://www.instagram.com/official_bnc/"
}
},
{
"title"
:
"Facebook"
,
"description"
:
"페이스북으로 이동"
,
"imageUrl"
:
"https://cdn-icons-png.flaticon.com/128/145/145802.png"
,
"link"
:
{
"web"
:
"https://m.facebook.com/khubounce"
}
},
{
"title"
:
"Youtube"
,
"description"
:
"유튜브로 이동"
,
"imageUrl"
:
"https://cdn-icons-png.flaticon.com/128/187/187209.png"
,
"link"
:
{
"web"
:
"https://m.youtube.com/channel/UCdqjjUiX3nTsr0neeC1ovvw"
}
}
]
}
}
]
}
}
return
club_data
;
}
haksa.js
0 → 100644
View file @
8046e73
const
express
=
require
(
'express'
);
const
app
=
express
();
app
.
use
(
express
.
urlencoded
({
extended
:
false
}));
app
.
use
(
express
.
json
());
var
haksa_data
;
//학사정보 간편보기
module
.
exports
.
Haksa_Information
=
function
(
haksa_data
){
haksa_data
=
{
"version"
:
"2.0"
,
"template"
:
{
"outputs"
:
[
{
"listCard"
:
{
"header"
:
{
"title"
:
"KHU 학사정보 알리미"
},
"items"
:
[
{
"title"
:
"장학금 공지사항"
,
"description"
:
"챗봇으로 손쉽게 알아보는 학사정보"
,
"imageUrl"
:
"https://mblogthumb-phinf.pstatic.net/20140716_293/envicontest_1405437648963lV4y4_GIF/University_Seal.gif?type=w2"
,
"link"
:
{
"web"
:
"https://www.khu.ac.kr/kor/notice/list.do?category=SCHOLARSHIP&page=1"
}
},
{
"title"
:
"공용 소프트웨어 필요할 땐?"
,
"description"
:
"경희대학교 정보처를 이용해보세요."
,
"imageUrl"
:
"https://cdn-icons.flaticon.com/png/128/2888/premium/2888407.png?token=exp=1638455259~hmac=d58c655e0ac8a16809b48323ea83a75f"
,
"link"
:
{
"web"
:
"https://ois.khu.ac.kr/index.do?sso=ok"
}
},
{
"title"
:
"학사 공지사항"
,
"description"
:
"학사 일정 공지사항 알아보기"
,
"imageUrl"
:
"https://cdn-icons.flaticon.com/png/128/3277/premium/3277431.png?token=exp=1638455425~hmac=4fe1afa937ad2ca62e17e25a34aa342e"
,
"link"
:
{
"web"
:
"https://www.khu.ac.kr/kor/notice/list.do?category=UNDERGRADUATE&page=1"
}
}
],
"buttons"
:
[
{
"label"
:
"홈페이지 구경가기"
,
"action"
:
"webLink"
,
"webLinkUrl"
:
"https://www.khu.ac.kr/kor/main/index.do"
}
]
}
}
]
}
}
return
haksa_data
;
}
\ No newline at end of file
haksik.js
0 → 100644
View file @
8046e73
const
express
=
require
(
'express'
);
const
app
=
express
();
app
.
use
(
express
.
urlencoded
({
extended
:
false
}));
app
.
use
(
express
.
json
());
var
haksik_data
;
module
.
exports
.
Seoul
=
function
(
haksik_data
){
const
goMain
=
'처음으로'
;
haksik_data
=
{
'version'
:
'2.0'
,
'template'
:
{
'outputs'
:
[{
'simpleImage'
:
{
'imageUrl'
:
"https://coop.khu.ac.kr/wp-content/uploads/2021/11/20211129-1301x2048.png"
,
'altText'
:
"서울캠퍼스 식단입니다."
}
}],
'quickReplies'
:
[{
'label'
:
goMain
,
'action'
:
'message'
,
'messageText'
:
goMain
}]
}
}
return
haksik_data
;
}
module
.
exports
.
Global
=
function
(
haksik_data
){
const
goMain
=
'처음으로'
;
haksik_data
=
{
"version"
:
"2.0"
,
"template"
:
{
"outputs"
:
[
{
"basicCard"
:
{
"title"
:
"국제캠퍼스 학식"
,
"description"
:
"오늘의 학식은 무엇일까?!"
,
"thumbnail"
:
{
"imageUrl"
:
"https://ww.namu.la/s/e38da99cb3bbad5d4a7f19a015fc2a888e01a7c996bb18465f8ba242a21ac5b3d1f2f977094552b00c706aab9c5c7e48dedae0103ed84d8039376458bebeaf0c43c7642b2544a52a016d0633eeab043924071315d41e15ef8df134009508ec03"
},
"profile"
:
{
"imageUrl"
:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT4BJ9LU4Ikr_EvZLmijfcjzQKMRCJ2bO3A8SVKNuQ78zu2KOqM"
,
"nickname"
:
"학식"
},
"social"
:
{
"like"
:
1238
,
"comment"
:
8
,
"share"
:
780
},
"buttons"
:
[
{
"action"
:
"webLink"
,
"label"
:
"학식보기"
,
"webLinkUrl"
:
"https://www.khu.ac.kr/kor/forum/list.do?type=RESTAURANT&category=INTL&page=1"
}
]
}
}
]
}
}
return
haksik_data
;
}
Please
register
or
login
to post a comment