박찬수

all commit

var data = require('./getid.js');
// 입력: 팀ID, 리그ID, 시즌 입력, 반환: 경기일정
function GetGameSchedule(teamID, leagueID, season, eventObj){
var request = require("request");
......@@ -130,5 +132,4 @@ function GetTeamStanding(teamID, season){
if (error) throw new Error(error);
console.log(body);
});
}
}
\ No newline at end of file
......
......@@ -129,14 +129,4 @@ exports.SearchLeague = function(){
exports.SearchTeam = function(teamName){
return GetTeamIDByName(teamName);
}
function SayHello(basic, trans){
console.log(basic + trans);
}
function BasicHello(basic, trans){
papago.TranslateKRtoEN(basic, function(transedMsg){
SayHello(basic, transedMsg);
});
}
\ No newline at end of file
......
This diff is collapsed. Click to expand it.
......@@ -15,6 +15,9 @@ var data = require('./getid.js');
const bodyParser = require('body-parser');
var currentLeagueID = 0;
var currentTeamID = 0;
data.SetData();
var app = express();
......@@ -100,10 +103,13 @@ function GetPlayerInfo(playerID, season, eventObj){
function SelectAPI(eventObj, commingMsg){
if(tryParse.int(commingMsg) != null){ // 리그 선택
SelectLeague(tryParse.int(commingMsg));
Reply(eventObj, SelectLeagueInfo);
}
else{ // 팀명 입력
papago.TranslateKRtoEN(commingMsg, function(transedMsg){
Reply(eventObj, transedMsg);
//Reply(eventObj, transedMsg);
currentTeamID = data.SearchTeam(transedMsg);
Reply(eventObj, SelectTeamInfo());
});
}
;
......@@ -145,6 +151,17 @@ function SelectLeague(inputNum){
default:
break;
}
currentLeagueID = leagueID;
console.log("Returned League ID : %d", leagueID);
return leagueID;
}
function SelectLeagueInfo(){
let msg = '1. 팀 순위 \n 2. 득점 순위 \n 3. 도움 순위';
return msg;
}
function SelectTeamInfo(){
let msg = '1. 경기 일정 \n 2. 소속 선수 \n 3. 순위';
return msg;
}
\ No newline at end of file
......