Storage of sports team and players data
Version: 0.0.1
Install Docker
Download deploy file
Execute the command
"docker compose -f ^path to downloaded file^ up"
Install JRE 8
Install PostgresQL
Download LiderIt.jar
Excecute:
"java -jar LiderIt.jar ^user^ ^password^>"
if you don't want automatically generated bd:
Execute createUser.sql
Execute createDB.sql
Execute:
"java -jar LiderIt.jar"
Swagger: https://app.swaggerhub.com/apis/MOROZOWAU/REST/1.0.0
Alternative:
TEAMS:
PLAYERS:
SERVER:
http://localhost:8080
Index
Code
Response Body
1
200
application/json
2
204
empty
id
name
sportKind
creationDate
1
Barcelona
Football
1899-11-29
2
Avangard
Hockey
1950-11-07
Table of Contents
Get list of teams and filtered by sportKind
GET /sport/teams/filters/sport-kinds
Name
Type
Required
Description
Example
sportKind
String(query)
True
Kind of sport
Football
Index
Code
Response Body
1
200
application/json
2
204
empty
id
name
sportKind
creationDate
1
Barcelona
Football
1899-11-29
2
Manchester United
Football
1879-01-01
Table of Contents
Get list of teams and filtered by date.
GET /sport/teams/filters/dates
Name
Type
Required
Description
Example
Format
startDate
String(query)
True
From date
1800-01-01
'yyyy-MM-dd'
endDate
String(query)
True
To date
2000-01-01
'yyyy-MM-dd'
Index
Code
Response Body
1
200
application/json
2
204
empty
3
400
application/json
4
400
application/json
id
name
sportKind
creationDate
1
Barcelona
Football
1899-11-29
2
Manchester United
Football
1879-01-01
3
Avangard
Hockey
1950-11-07
message
date
The endDate cannot be earlier than the startDate [2100-01-01, 2200-01-01]
2023-03-21T02:56:20.368
message
date
description
Failed to convert value of type 'java.lang.String' to required type 'java.time.LocalDate'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.RequestParam @org.springframework.format.annotation.DateTimeFormat java.time.LocalDate] for value '220-01-01'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [220-01-01]
2023-03-21T03:38:00.79
220-01-01: incorrect format. Format must be 'yyyy-MM-dd'
Table of Contents
name
sportKind
creationDate
Barcelona
Football
1899-11-29
Index
Code
Response Body
1
201
application/json
2
400
empty
id
name
sportKind
creationDate
1
Barcelona
Football
1899-11-29
Table of Contents
PUT /sports/teams/{teamId}
Name
Type
Required
Description
Example
teamId
Integer(path)
True
Numeric id of the team to get
1
name
sportKind
creationDate
Barcelona
Football
1899-11-29
Index
Code
Response Body
1
200
application/json
2
201
application/json
3
400
empty
id
name
sportKind
creationDate
1
Barcelona
Football
1899-11-29
id
name
sportKind
creationDate
2
Barcelona
Football
1899-11-29
Table of Contents
DELETE /sports/teams/{teamId}
Name
Type
Required
Description
Example
teamId
Integer(path)
True
Numeric id of the team to get
1
Index
Code
Response Body
1
204
empty
2
404
application/json
message
date
Team with id:1 not found
2023-03-21T02:56:20.368
Table of Contents
Get players of team by teamId
GET /sports/players/{teamId}
Name
Type
Required
Description
Example
teamId
Integer(path)
True
Numeric ID of the team to get
1
Index
Code
Response Body
1
200
application/json
2
204
empty
3
404
application/json
id
name
surname
birthDate
role
1
Ander
Astralaga
2004-03-03
Goalkeeper
2
Arnau
Tenas
2001-05-30
Goalkeeper
message
date
Team with id:100 not found
2023-03-21T04:24:28.745
Table of Contents
Get list of players from team by role
GET /sports/players/{teamId}/filters/roles
Name
Type
Required
Description
Example
role
String(query)
True
Name of role
Goalkeeper
teamId
Integer(path)
True
Numeric ID of the team to get
1
name
surname
birthDate
role
Ander
Astralaga
2004-03-03
Goalkeeper
Index
Code
Response Body
1
201
application/json
2
404
application/json
id
name
surname
birthDate
role
1
Ander
Astralaga
2004-03-03
Goalkeeper
message
date
Team with id:1 not found
2023-03-21T02:56:20.368
Table of Contents
POST /sports/players/{playerId}
name
surname
birthDate
role
Ander
Astralaga
2004-03-03
Goalkeeper
Name
Type
Required
Description
Example
teamId
Integer(path)
True
Numeric ID of the team to get
1
Index
Code
Response Body
1
201
application/json
2
404
application/json
id
name
surname
birthDate
role
1
Ander
Astralaga
2004-03-03
Goalkeeper
message
date
Team with id:1 not found
2023-03-21T02:56:20.368
Table of Contents
PATCH /sports/players/{playerId}
Name
Type
Required
Description
Example
newTeamId
Integer(query)
True
Numeric ID of new team to player
2
playerId
Integer(path)
True
Numeric ID of the player to get
1
Index
Code
Response Body
1
200
application/json
2
400
application/json
id
name
sportKind
creationDate
2
Manchester United
Football
1879-01-01
message
date
Team with id:1 not found
2023-03-21T02:56:20.368
Table of Contents
Put new data to the player by teamId
PUT /sports/players/{playerId}
Name
Type
Required
Description
Example
playerId
Integer(path)
True
Numeric ID of the player to get
1
name
surname
birthDate
role
Ander
Astralaga
2004-03-03
Goalkeeper
Index
Code
Response Body
1
200
application/json
2
404
application/json
id
name
surname
birthDate
role
1
Ander
Astralaga
2004-03-03
Goalkeeper
message
date
Player with id:1 not found
2023-03-21T02:56:20.368
Table of Contents
Delete a player by playerId
DELETE /sports/players/{playerId}
Name
Type
Required
Description
Example
playerId
Integer(path)
True
Numeric ID of the player to get
1
Index
Code
Response Body
1
204
empty
2
404
application/json
message
date
Player with id:1 not found
2023-03-21T02:56:20.368
Table of Contents