@@ -13,8 +13,8 @@ defmodule LolAnalytics.Analyzer.ChampionAnalyzer do
|
||||
@doc """
|
||||
iex> LolAnalytics.Analyzer.ChampionAnalyzer.analyze(:url, "http://localhost:9000/ranked/14.9.580.2108/EUW1_6923309745.json")
|
||||
"""
|
||||
@spec analyze(any(), any()) :: none()
|
||||
@impl true
|
||||
@spec analyze(atom(), String.t()) :: :ok
|
||||
def analyze(:url, path) do
|
||||
data = HTTPoison.get!(path)
|
||||
analyze(:data, data.body)
|
||||
@@ -22,7 +22,6 @@ defmodule LolAnalytics.Analyzer.ChampionAnalyzer do
|
||||
end
|
||||
|
||||
@impl true
|
||||
@spec analyze(atom(), any()) :: list(LoLAPI.Model.Participant.t())
|
||||
def analyze(:data, data) do
|
||||
decoded_match = Poison.decode!(data, as: %LoLAPI.Model.MatchResponse{})
|
||||
participants = decoded_match.info.participants
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
defmodule LolAnalytics.Facts.ChampionPlayedGame.ChampionPlayedGameRepo do
|
||||
|
||||
end
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
defmodule LolAnalytics.Facts.ChampionPlayedGame.ChampionPlayedGameSchema do
|
||||
use Ecto.Schema
|
||||
|
||||
schema "fact_champion_played_game" do
|
||||
field :champion_id, :integer
|
||||
field :match_id, :integer
|
||||
field :is_win, :boolean
|
||||
field :game_length_seconds, :integer
|
||||
field :queue_id, :integer
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user