Repository navigation
API
Jeong InHo edited this page May 12, 2021
·
14 revisions
POST ip/login?code={asdf3421}
query params
code
200 Ok
{
"name": "Jeong In Ho",
"email": "derosatam76@gmail.com",
"userId": "eNoLJ",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MjA2OTc3MjAsInVzZXJJZCI6ImVOb0xKIn0.Pv8Lfs90B7LRyCqKrob3RGjDtMgAk9ahdB8pRM1MY9Q"
}400 Bad Request
{
"timestamp": "2021-05-12T08:17:36.148+00:00",
"status": 400,
"error": "Bad Request",
"message": "OAuth 인증에 실패 했습니다.",
"path": "/login"
}GET ip/logout
header
Authorization: Bearer {token}
200 Ok
401 Unauthorized
{
"timestamp": "2021-05-12T08:20:59.720+00:00",
"status": 401,
"error": "Unauthorized",
"message": "유효하지 않은 토큰입니다.",
"path": "/logout"
}GET ip/members/{teamName}
200 Ok
[
{
"id": 1,
"name": "김광진",
"AVG": 0.32
},
{
"id": 2,
"name": "류현진",
"AVG": 0.33
}
]400 Bad Request
{
"timestamp": "2021-05-12T08:23:31.649+00:00",
"status": 400,
"error": "Bad Request",
"message": "해당 엔티티를 찾을 수 없습니다.",
"path": "/members/Tiger"
}GET ip/games
header
Authorization: Bearer {token}
200 Ok
[
{
"homeTeamName": "marvel",
"awayTeamName": "tigers"
},
{
"homeTeamName": "tigers",
"awayTeamName": "twins"
}
]401 Unauthorized
{
"timestamp": "2021-05-12T08:20:59.720+00:00",
"status": 401,
"error": "Unauthorized",
"message": "유효하지 않은 토큰입니다.",
"path": "/logout"
}POST ip/games/{teamName}
header
Authorization: Bearer {token}
200 Ok
{
"playTeam": "captin",
"roundInfo": {
"round": 2,
"strike": 1,
"ball": 2,
"out": 1,
"firstBase": true,
"secondBase": false,
"thirdBase": true
},
"offenceTeam": {
"teamName": "captin(away team의 선공)",
"score": 1
"hitter": {
"name": "류현진",
"AVG(타율)": 0.312,
"TPA(타석)": 2,
"hits(안타)": 1
}
},
"defenseTeam": {
"teamName": "Marvel(home team의 후공)",
"score": 5
"pitcher": {
"name": "최동원",
"pit(투구)": 39
}
},
"story": ["볼(오래됨)", "스트라이크"]
}400 Bad Request
{
"timestamp": "2021-05-12T08:23:31.649+00:00",
"status": 400,
"error": "Bad Request",
"message": "해당 엔티티를 찾을 수 없습니다.",
"path": "/members/Tiger"
}401 Unauthorized
{
"timestamp": "2021-05-12T08:20:59.720+00:00",
"status": 401,
"error": "Unauthorized",
"message": "유효하지 않은 토큰입니다.",
"path": "/logout"
}PATCH ip/games (공수 교대 X)
POST ip/games (공수 교대 O)
header
Authorization: Bearer {token}
body
{
"playTeam": "captin",
"roundInfo": {
"round": 2,
"strike": 1,
"ball": 2,
"out": 1,
"firstBase": true,
"secondBase": false,
"thirdBase": true
},
"offenceTeam": {
"teamName": "captin",
"score": 1
"hitter": {
"name": "류현진",
"AVG": 0.312,
"TPA": 2,
"hits": 1
}
},
"defenseTeam": {
"teamName": "Marvel",
"score": 5
"pitcher": {
"name": "최동원",
"pit": 39
}
},
"story": ["볼", "스트라이크"]
}200 Ok
{
"playTeam": "captin",
"roundInfo": {
"round": 2,
"strike": 1,
"ball": 2,
"out": 1,
"firstBase": true,
"secondBase": false,
"thirdBase": true
},
"offenceTeam": {
"teamName": "captin",
"score": 1
"hitter": {
"name": 류현진,
"AVG": 0.312,
"TPA": 2,
"hits": 1
}
},
"defenseTeam": {
"teamName": "Marvel",
"score": 5
"pitcher": {
"name": "최동원",
"pit": 39
}
},
"story": ["볼", "스트라이크"]
}400 Bad Request
{
"timestamp": "2021-05-12T08:23:31.649+00:00",
"status": 400,
"error": "Bad Request",
"message": "해당 엔티티를 찾을 수 없습니다.",
"path": "/members/Tiger"
}401 Unauthorized
{
"timestamp": "2021-05-12T08:20:59.720+00:00",
"status": 401,
"error": "Unauthorized",
"message": "유효하지 않은 토큰입니다.",
"path": "/logout"
}GET ip/games/scores
header
Authorization: Bearer {token}
{
"homeTeam": {
"teamName": "marvel",
"scores": [1, 0, 0, 0]
},
"awayTeam": {
"teamName": "captin",
"scores": [1, 2, 2]
},
}400 Bad Request
{
"timestamp": "2021-05-12T08:23:31.649+00:00",
"status": 400,
"error": "Bad Request",
"message": "해당 엔티티를 찾을 수 없습니다.",
"path": "/members/Tiger"
}401 Unauthorized
{
"timestamp": "2021-05-12T08:20:59.720+00:00",
"status": 401,
"error": "Unauthorized",
"message": "유효하지 않은 토큰입니다.",
"path": "/logout"
}GET ip/games/scores/{teamName}
header
Authorization: Bearer {token}
[
{
"id": 1,
"name": 김광진,
"TPA": 1,
"hits": 1,
"out": 0
},
{
"id": 2,
"name": 류현진,
"TPA": 1,
"hits": 0,
"out": 1
}
]400 Bad Request
{
"timestamp": "2021-05-12T08:23:31.649+00:00",
"status": 400,
"error": "Bad Request",
"message": "해당 엔티티를 찾을 수 없습니다.",
"path": "/members/Tiger"
}401 Unauthorized
{
"timestamp": "2021-05-12T08:20:59.720+00:00",
"status": 401,
"error": "Unauthorized",
"message": "유효하지 않은 토큰입니다.",
"path": "/logout"
}