Showing
4 changed files
with
20 additions
and
12 deletions
1 | +var data = require('./getid.js'); | ||
2 | + | ||
1 | // 입력: 팀ID, 리그ID, 시즌 입력, 반환: 경기일정 | 3 | // 입력: 팀ID, 리그ID, 시즌 입력, 반환: 경기일정 |
2 | function GetGameSchedule(teamID, leagueID, season, eventObj){ | 4 | function GetGameSchedule(teamID, leagueID, season, eventObj){ |
3 | var request = require("request"); | 5 | var request = require("request"); |
... | @@ -131,4 +133,3 @@ function GetTeamStanding(teamID, season){ | ... | @@ -131,4 +133,3 @@ function GetTeamStanding(teamID, season){ |
131 | console.log(body); | 133 | console.log(body); |
132 | }); | 134 | }); |
133 | } | 135 | } |
... | \ No newline at end of file | ... | \ No newline at end of file |
134 | - | ... | ... |
... | @@ -130,13 +130,3 @@ exports.SearchLeague = function(){ | ... | @@ -130,13 +130,3 @@ exports.SearchLeague = function(){ |
130 | exports.SearchTeam = function(teamName){ | 130 | exports.SearchTeam = function(teamName){ |
131 | return GetTeamIDByName(teamName); | 131 | return GetTeamIDByName(teamName); |
132 | } | 132 | } |
... | \ No newline at end of file | ... | \ No newline at end of file |
133 | - | ||
134 | -function SayHello(basic, trans){ | ||
135 | - console.log(basic + trans); | ||
136 | -} | ||
137 | - | ||
138 | -function BasicHello(basic, trans){ | ||
139 | - papago.TranslateKRtoEN(basic, function(transedMsg){ | ||
140 | - SayHello(basic, transedMsg); | ||
141 | - }); | ||
142 | -} | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed. Click to expand it.
... | @@ -15,6 +15,9 @@ var data = require('./getid.js'); | ... | @@ -15,6 +15,9 @@ var data = require('./getid.js'); |
15 | 15 | ||
16 | const bodyParser = require('body-parser'); | 16 | const bodyParser = require('body-parser'); |
17 | 17 | ||
18 | +var currentLeagueID = 0; | ||
19 | +var currentTeamID = 0; | ||
20 | + | ||
18 | data.SetData(); | 21 | data.SetData(); |
19 | 22 | ||
20 | var app = express(); | 23 | var app = express(); |
... | @@ -100,10 +103,13 @@ function GetPlayerInfo(playerID, season, eventObj){ | ... | @@ -100,10 +103,13 @@ function GetPlayerInfo(playerID, season, eventObj){ |
100 | function SelectAPI(eventObj, commingMsg){ | 103 | function SelectAPI(eventObj, commingMsg){ |
101 | if(tryParse.int(commingMsg) != null){ // 리그 선택 | 104 | if(tryParse.int(commingMsg) != null){ // 리그 선택 |
102 | SelectLeague(tryParse.int(commingMsg)); | 105 | SelectLeague(tryParse.int(commingMsg)); |
106 | + Reply(eventObj, SelectLeagueInfo); | ||
103 | } | 107 | } |
104 | else{ // 팀명 입력 | 108 | else{ // 팀명 입력 |
105 | papago.TranslateKRtoEN(commingMsg, function(transedMsg){ | 109 | papago.TranslateKRtoEN(commingMsg, function(transedMsg){ |
106 | - Reply(eventObj, transedMsg); | 110 | + //Reply(eventObj, transedMsg); |
111 | + currentTeamID = data.SearchTeam(transedMsg); | ||
112 | + Reply(eventObj, SelectTeamInfo()); | ||
107 | }); | 113 | }); |
108 | } | 114 | } |
109 | ; | 115 | ; |
... | @@ -145,6 +151,17 @@ function SelectLeague(inputNum){ | ... | @@ -145,6 +151,17 @@ function SelectLeague(inputNum){ |
145 | default: | 151 | default: |
146 | break; | 152 | break; |
147 | } | 153 | } |
154 | + currentLeagueID = leagueID; | ||
148 | console.log("Returned League ID : %d", leagueID); | 155 | console.log("Returned League ID : %d", leagueID); |
149 | return leagueID; | 156 | return leagueID; |
150 | } | 157 | } |
158 | + | ||
159 | +function SelectLeagueInfo(){ | ||
160 | + let msg = '1. 팀 순위 \n 2. 득점 순위 \n 3. 도움 순위'; | ||
161 | + return msg; | ||
162 | +} | ||
163 | + | ||
164 | +function SelectTeamInfo(){ | ||
165 | + let msg = '1. 경기 일정 \n 2. 소속 선수 \n 3. 순위'; | ||
166 | + return msg; | ||
167 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment