윤준현

fix some stuffes

add youtube link. etc...
Showing 1 changed file with 33 additions and 2 deletions
......@@ -36,6 +36,7 @@ app.post('/message', function(req,res){
console.log('전달받은 메시지 : ' + msg);
var send = {};
var task = [
// 앨범 정보를 읽어오는 함수 //
function(callback){
switch(msg){
case 'Reol-Discography' :
......@@ -78,6 +79,9 @@ app.post('/message', function(req,res){
}
},
// 사용자의 msg를 받아 res를 보냄 //
function(discography, callback){
var index = parseInt(msg[0])-1;
switch (msg) {
......@@ -97,7 +101,7 @@ app.post('/message', function(req,res){
case '한국':
send = {
'message': {
'text': '등록된 가수 목록입니다.'
'text': '미구현'
},
keyboard: {
'type': 'buttons',
......@@ -106,7 +110,9 @@ app.post('/message', function(req,res){
};
break;
// ---------- contents -------------- //
///////////////
///// Reol ////
///////////////
case 'Reol' :
send = {
'message' : {
......@@ -147,7 +153,9 @@ app.post('/message', function(req,res){
}
}
break;
///////////////
/// 米津玄師 ///
///////////////
case '米津玄師':
send = {
'message': {
......@@ -189,6 +197,9 @@ app.post('/message', function(req,res){
};
break;
//////////////
// ヨルシカ //
/////////////
case 'ヨルシカ':
send = {
'message': {
......@@ -230,7 +241,14 @@ app.post('/message', function(req,res){
};
break;
/////////////
//// MOT ////
/////////////
// 앨범 정보 읽기 //
case discography[0].json_album[index]:
var album = '앨범 : ' + discography[0].json_album[index].substr(3);
if (singer == 'Reol') {
......@@ -267,6 +285,9 @@ app.post('/message', function(req,res){
}
}
break;
// 초기 설정으로 돌아가기 //
case '초기화면' :
send = {
'message' : {
......@@ -279,14 +300,24 @@ app.post('/message', function(req,res){
}
break;
default:
send = {
'message': {
'text': '잘못된 입력입니다. \n초기화면으로 이동합니다.'
},
keyboard: {
'type': 'buttons',
'buttons': ['일본', '한국']
}
}
break;
}
callback(null ,send);
}
];
// async의 waterfall을 통해 함수를 순차적으로 실행 //
async.waterfall(task, function(err,result){
console.log(send);
res.json(send);
});
});
\ No newline at end of file
......