The Trybets project consists of the backend of a betting site. In this project the application has already come ready in monolithic format, my participation in the project was to divide this application into microservices with certain specificities.
5502 .
/TeamRoute used to obtain the list of teams.
| Request | Token? | Status | Response |
|---|---|---|---|
| (blank) | No | 200 | [
{
"teamId" : 1 ,
"teamName" : " Sharks "
}, /*...*/
]
|
/match/{finished} Route used to obtain the list of matches. Parameter {Finished} varies between true and false to list finished or not.
| Request | Token? | Status | Response |
|---|---|---|---|
| (blank) | No | 200 | [
{
"matchId" : 1 ,
"matchDate" : " 2023-07-23T15:00:00 " ,
"matchTeamAId" : 1 ,
"matchTeamBId" : 8 ,
"teamAName" : " Sharks " ,
"teamBName" : " Bulls " ,
"matchTeamAOdds" : " 3,33 " ,
"matchTeamBOdds" : " 1,43 " ,
"matchFinished" : true ,
"matchWinnerId" : 1
}, /*...*/
]
|
/user/signupRoute used to register a new user person. By successfully registering, a token returns. Not allowed to add two people users with the same email.
| Request | Token? | Status | Response | Observations |
|---|---|---|---|---|
{
"Name" : " Isabel Santos " ,
"Email" : " [email protected] " ,
"Password" : " 123456 "
} | No | 201 | {
"token" : " eyJhbG... "
} | |
{
"Name" : " Isabel Santos " ,
"Email" : " [email protected] " ,
"Password" : " 123456 "
} | No | 400 | {
"message" : " E-mail already used "
} | If the user's e-mail has already been registered with the database. |
/user/loginRoute used to login from a user person.
| Request | Token? | Status | Response | Observations |
|---|---|---|---|---|
{
"Email" : " [email protected] " ,
"Password" : " 123456 "
}
| No | 200 | {
"token" : " eyJhbG... "
}
| |
{
"Email" : " [email protected] " ,
"Password" : " 1234567 "
}
| No | 400 | {
"message" : " Authentication failed "
}
| If the user person does not have the data authenticated or inform any of the parameters correctly. |
/BETRoute used to make a new bet
| Request | Token? | Status | Response | Observations |
|---|---|---|---|---|
{
"MatchId" : 5 ,
"TeamId" : 2 ,
"BetValue" : 550.65
}
| Yes | 201 | {
"betId" : 1 ,
"matchId" : 5 ,
"teamId" : 2 ,
"betValue" : 550.65 ,
"matchDate" : " 2024-03-15T14:00:00 " ,
"teamName" : " Eagles " ,
"email" : " [email protected] "
}
| |
{
"MatchId" : 5 ,
"TeamId" : 2 ,
"BetValue" : 550.65
}
| No | 401 | If the token has not been informed or is wrong | |
{
"MatchId" : 5 ,
"TeamId" : 6 ,
"BetValue" : 550.65
}
| Yes | 400 | {
"message" : " Team is not in this match "
}
| If the team is not in the correct match |
{
"MatchId" : 5 ,
"TeamId" : 60 ,
"BetValue" : 550.65
}
| Yes | 400 | {
"message" : " Team not founded "
}
| If the team does not exist |
{
"MatchId" : 50 ,
"TeamId" : 6 ,
"BetValue" : 550.65
}
| Yes | 400 | {
"message" : " Match not founded "
}
| If the match does not exist |
{
"MatchId" : 1 ,
"TeamId" : 6 ,
"BetValue" : 550.65
}
| Yes | 400 | {
"message" : " Match finished "
}
| If the match has already been finalized |
/Bet/{Betid}Route used to view a created bet. A bet can only be viewed by the person who created it.
| Request | Token? | Status | Response | Observations |
|---|---|---|---|---|
| Yes | 200 | {
"betId" : 1 ,
"matchId" : 5 ,
"teamId" : 2 ,
"betValue" : 550.65 ,
"matchDate" : " 2024-03-15T14:00:00 " ,
"teamName" : " Eagles " ,
"email" : " [email protected] "
}
| ||
| Yes | 400 | (Indifferent) | If the bet does not belong to the token -user person. | |
| Yes | 400 | {
"message" : " Bet not founded "
}
| If the bet does not exist. | |
| No | 401 | If a token is not informed. |
This microservice will be responsible for updating the odds of each match. This microservice is new and is not accessible to the site. It will be used by microservice Trybets.bets and will be called by this every time a new bet is registered.
This microservice works on door 5504.
The necessary route in this microservice is:
PATCH /Odd/{Matchid}/{Teamid}/{BetValue} # Clone o projeto
$ git clone [email protected]:wesleymktd/project-trybets.git
# Acesse
$ cd ./project-trybets/src
# Instale as dependencias
$ dotnet restore
# Acesse o diretório TrybeHotel
$ cd TrybeHotel
# Inicie o projeto
$ dotnet run