Toggle navigation
Toggle navigation
This project
Loading...
Sign in
박찬수
/
enjoy_soccer
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-09 11:22:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
43e073521907ffa7fca5040b5aba8243a43d8dfe
43e07352
1 parent
07773f1b
commit all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
18 deletions
appfunctions.js
reply.js
transmessage.js
appfunctions.js
View file @
43e0735
...
...
@@ -19,7 +19,7 @@ function GetGameSchedule(teamID, leagueID, season, eventObj){
}
// 입력: 리그ID, 시즌(*필수) 반환: 팀 순위
function
GetLeagueStanding
(
leagueID
,
season
){
function
GetLeagueStanding
(
leagueID
,
season
,
callbackFunc
){
var
request
=
require
(
"request"
);
var
options
=
{
method
:
'GET'
,
...
...
@@ -33,19 +33,16 @@ function GetLeagueStanding(leagueID, season){
request
(
options
,
function
(
error
,
response
,
body
)
{
if
(
error
)
throw
new
Error
(
error
);
console
.
log
(
body
);
let
jsonBody
=
JSON
.
parse
(
body
);
console
.
log
(
jsonBody
);
console
.
log
(
jsonBody
.
response
[
0
]);
console
.
log
(
jsonBody
.
response
[
0
].
league
);
for
(
var
i
=
0
;
i
<
20
;
i
++
){
console
.
log
(
jsonBody
.
response
[
0
].
league
.
standings
[
0
][
i
].
rank
+
"|"
+
jsonBody
.
response
[
0
].
league
.
standings
[
0
][
i
].
team
.
name
);
}
callbackFunc
(
body
);
});
}
exports
.
LeagueStanding
=
function
(
leagueID
,
callbackFunc
){
GetLeagueStanding
(
leagueID
,
2021
,
callbackFunc
);
}
// 입력: 리그ID(*필수), 시즌(*필수), 반환: (선수) 득점 순위
function
GetTopScorer
(
leagueID
,
season
){
function
GetTopScorer
(
leagueID
,
season
,
callbackFunc
){
var
request
=
require
(
"request"
);
var
options
=
{
method
:
'GET'
,
...
...
@@ -59,11 +56,16 @@ function GetTopScorer(leagueID, season){
request
(
options
,
function
(
error
,
response
,
body
)
{
if
(
error
)
throw
new
Error
(
error
);
console
.
log
(
body
);
callbackFunc
(
body
);
});
}
exports
.
TopScorer
=
function
(
leagueID
,
callbackFunc
){
GetTopScorer
(
leagueID
,
2021
,
callbackFunc
);
}
// 입력: 리그ID(*필수), 시즌(*필수), 반환: 도움 순위
function
GetTopAssist
(
leagueID
,
season
){
function
GetTopAssist
(
leagueID
,
season
,
callbackFunc
){
var
request
=
require
(
"request"
);
var
options
=
{
method
:
'GET'
,
...
...
@@ -77,9 +79,14 @@ function GetTopAssist(leagueID, season){
request
(
options
,
function
(
error
,
response
,
body
)
{
if
(
error
)
throw
new
Error
(
error
);
console
.
log
(
body
);
callbackFunc
(
body
)
});
}
exports
.
TopAssist
=
function
(
leagueID
,
callbackFunc
){
GetTopAssist
(
leagueID
,
2021
,
callbackFunc
);
}
// 입력: 팀ID, 반환: 경기 일정
function
GetGameSchedule_teamname
(
teamID
){
var
request
=
require
(
"request"
);
...
...
@@ -132,4 +139,7 @@ function GetTeamStanding(teamID, season){
if
(
error
)
throw
new
Error
(
error
);
console
.
log
(
body
);
});
}
\ No newline at end of file
}
...
...
reply.js
View file @
43e0735
...
...
@@ -170,7 +170,20 @@ function SelectLeague(inputNum){
}
function
SelectLeagueInfo
(
inputNum
){
return
'You Selected '
+
inputNum
.
toString
();
let
returnMsg
=
"잘 못 고르겼습니다. 다시 골라주세요."
switch
(
inputNum
){
case
1
:
// 팀 순위
break
;
case
2
:
// 득점 순위
break
;
case
3
:
// 도움 순위
break
;
case
4
:
// 처음으로
break
;
default
:
break
;
}
return
returnMsg
;
}
function
SelectTeamInfo
(
inputNum
){
...
...
transmessage.js
View file @
43e0735
...
...
@@ -14,7 +14,7 @@ const bodyParser = require('body-parser');
const
{
post
}
=
require
(
'request'
);
const
req
=
require
(
'express/lib/request'
);
function
transMsg
(
replyMsg
){
function
transMsg
(
replyMsg
,
callbackFunc
){
var
language
=
"ko"
;
request
.
post
(
...
...
@@ -31,10 +31,9 @@ function transMsg(replyMsg){
if
(
!
error
&&
response
.
statusCode
==
200
)
{
let
transMessage
=
body
.
message
.
result
.
translatedText
;
console
.
log
(
transMessage
);
return
transMessage
;
callbackFunc
(
transMessage
)
;
}
});
return
replyMsg
;
}
function
transMsg_toEn
(
replyMsg
,
callbackFunc
){
...
...
@@ -64,7 +63,7 @@ exports.TranslateKRtoEN = function(transMsg, callbackFunc){
transMsg_toEn
(
transMsg
,
callbackFunc
);
}
exports
.
TranslateENtoKR
=
function
(
transMsg
){
return
transMsg
(
transMsg
);
exports
.
TranslateENtoKR
=
function
(
transMsg
,
callbackFunc
){
transMsg
(
transMsg
,
callbackFunc
);
}
...
...
Please
register
or
login
to post a comment