Move api related modules to api dir

This commit is contained in:
Álvaro 2024-05-01 13:58:39 +02:00
parent df34d7b8c5
commit 7ebcab23ea
6 changed files with 12 additions and 13 deletions

View File

@ -1,5 +1,5 @@
defmodule Scrapper.Data.Model.Match.Info do
alias Scrapper.Data.Model.Match.Participant
defmodule Scrapper.Data.Api.Model.Match.Info do
alias Scrapper.Data.Api.Model.Match.Participant
defstruct endOfGameResult: "",
gameCreation: "",

View File

@ -0,0 +1,6 @@
defmodule Scrapper.Data.Api.Model.Match.MatchResponse do
alias Scrapper.Data.Api.Model.Match.{Info, Metadata}
defstruct metadata: %Metadata{},
info: %Info{}
end

View File

@ -1,3 +1,3 @@
defmodule Scrapper.Data.Model.Match.Metadata do
defmodule Scrapper.Data.Api.Model.Match.Metadata do
defstruct [:dataVersion, :matchId, :participants]
end

View File

@ -1,4 +1,4 @@
defmodule Scrapper.Data.Model.Match.Participant do
defmodule Scrapper.Data.Api.Model.Match.Participant do
# Enum.map(participant, fn {k,_v} -> ":#{k}" end) |> Enum.join(", ")
defstruct [
:onMyWayPings,

View File

@ -1,4 +1,4 @@
defmodule Scrapper.Data.MatchApi do
defmodule Scrapper.Data.Api.MatchApi do
@match_base_endpoint "https://europe.api.riotgames.com/lol/match/v5/matches/%{matchid}"
@puuid_matches_base_endpoint "https://europe.api.riotgames.com/lol/match/v5/matches/by-puuid/%{puuid}/ids"
@ -18,7 +18,7 @@ defmodule Scrapper.Data.MatchApi do
200 ->
# process the response here
response.body
Poison.decode!(response.body, as: %Scrapper.Data.Model.Match.MatchResponse{})
Poison.decode!(response.body, as: %Scrapper.Data.Api.Model.Match.MatchResponse{})
_ ->
# handle error responses

View File

@ -1,7 +0,0 @@
defmodule Scrapper.Data.Model.Match.MatchResponse do
alias Scrapper.Data.Model.Match.Info
alias Scrapper.Data.Model.Match.Metadata
defstruct metadata: %Metadata{},
info: %Info{}
end