-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new /maps endpoint from static data (#12)
- Loading branch information
Valentin Porchet
committed
Jan 29, 2023
1 parent
748948c
commit 88ccc40
Showing
66 changed files
with
400 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
key;name;gamemodes;location;country_code | ||
hanamura;Hanamura;assault;Tokyo, Japan;JP | ||
horizon;Horizon Lunar Colony;assault;Earth's moon; | ||
paris;Paris;assault;Paris, France;FR | ||
anubis;Temple of Anubis;assault;Giza Plateau, Egypt;EG | ||
volskaya;Volskaya Industries;assault;St. Petersburg, Russia;RU | ||
ayutthaya;Ayutthaya;capture-the-flag;Thailand;TH | ||
busan;Busan;control;South Korea;KR | ||
nepal;Nepal;control;Nepal;NP | ||
ilios;Ilios;control;Greece;GR | ||
oasis;Oasis;control;Iraq;IQ | ||
lijiang;Lijiang Tower;control;China;CN | ||
chateau_guillard;Château Guillard;deathmatch,team-deathmatch;Annecy, France;FR | ||
kanezaka;Kanezaka;deathmatch,team-deathmatch;Tokyo, Japan;JP | ||
malevento;Malevento;deathmatch,team-deathmatch;Italy;IT | ||
petra;Petra;deathmatch,team-deathmatch;Southern Jordan;JO | ||
black_forest;Black Forest;elimination;Germany;DE | ||
castillo;Castillo;elimination;Mexico;MX | ||
ecopoint_antarctica;Ecopoint: Antarctica;elimination;Antarctica;AQ | ||
necropolis;Necropolis;elimination;Egypt;EG | ||
circuit_royal;Circuit Royal;escort;Monte Carlo, Monaco;MC | ||
dorado;Dorado;escort;Mexico;MX | ||
route_66;Route 66;escort;Albuquerque, New Mexico, United States;US | ||
junkertown;Junkertown;escort;Central Australia;AU | ||
rialto;Rialto;escort;Venice, Italy;IT | ||
havana;Havana;escort;Havana, Cuba;CU | ||
gibraltar;Watchpoint: Gibraltar;escort;Gibraltar;GI | ||
shambali;Shambali Monastery;escort;Nepal;NP | ||
blizzard_world;Blizzard World;hybrid;Irvine, California, United States;US | ||
numbani;Numbani;hybrid;Numbani (near Nigeria); | ||
hollywood;Hollywood;hybrid;Los Angeles, United States;US | ||
eichenwalde;Eichenwalde;hybrid;Stuttgart, Germany;DE | ||
kings_row;King’s Row;hybrid;London, United Kingdom;UK | ||
midtown;Midtown;hybrid;New York, United States;US | ||
paraiso;Paraíso;hybrid;Rio de Janeiro, Brazil;BR | ||
colosseo;Colosseo;push;Rome, Italy;IT | ||
esperanca;Esperança;push;Portugal;PT | ||
new_queen_street;New Queen Street;push;Toronto, Canada;CA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"""List Maps Request Handler module""" | ||
from overfastapi.config import HOME_PATH_CACHE_TIMEOUT | ||
from overfastapi.handlers.api_request_handler import APIRequestHandler | ||
from overfastapi.parsers.maps_parser import MapsParser | ||
|
||
|
||
class ListMapsRequestHandler(APIRequestHandler): | ||
"""List Maps Request Handler used in order to retrieve a list of | ||
available Overwatch maps, using the MapsParser class. | ||
""" | ||
|
||
parser_classes = [MapsParser] | ||
timeout = HOME_PATH_CACHE_TIMEOUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Set of pydantic models used for Maps API routes""" | ||
from pydantic import BaseModel, Field, HttpUrl | ||
|
||
from overfastapi.common.enums import MapGamemode | ||
|
||
|
||
class Map(BaseModel): | ||
name: str = Field(..., description="Name of the map", example="Hanamura") | ||
screenshot: HttpUrl = Field( | ||
..., | ||
description="Screenshot of the map", | ||
example="https://overfast-api.tekrop.fr/static/maps/hanamura.jpg", | ||
) | ||
gamemodes: list[MapGamemode] = Field( | ||
..., description="Main gamemodes on which the map is playable" | ||
) | ||
location: str = Field( | ||
..., description="Location of the map", example="Tokyo, Japan" | ||
) | ||
country_code: str | None = Field( | ||
None, | ||
min_length=2, | ||
max_length=2, | ||
description=( | ||
"Country Code of the location of the map. If not defined, it's null." | ||
), | ||
example="JP", | ||
) |
Oops, something went wrong.