Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit b71ecb0

Browse files
committed
refactor(dir): statistics model wip
1 parent 1c04d6b commit b71ecb0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/groupher_server/statistics/delegates/geo.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule GroupherServer.Statistics.Delegate.Geo do
66
import Helper.Utils
77
import ShortMaps
88

9-
alias GroupherServer.Statistics.UserGeoInfo
9+
alias GroupherServer.Statistics.Model.UserGeoInfo
1010
alias Helper.ORM
1111

1212
def inc_count(city) do

lib/helper/geo_pool.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule Helper.GeoPool do
55

66
alias GroupherServer.Statistics
77

8-
alias Statistics.UserGeoInfo
8+
alias Statistics.Model.UserGeoInfo
99
alias Helper.ORM
1010

1111
def all do

test/groupher_server/statistics/geo_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule GroupherServer.Test.Statistics.Geo do
22
use GroupherServer.TestTools
33

44
alias Helper.{ORM, GeoPool}
5-
alias GroupherServer.{Statistics}
5+
alias GroupherServer.Statistics.Model.UserGeoInfo
66

77
setup do
88
GeoPool.insert_geo_data()
@@ -12,15 +12,15 @@ defmodule GroupherServer.Test.Statistics.Geo do
1212

1313
describe "[statistics geo inc] " do
1414
test "geo data can be inc by city" do
15-
{:ok, _} = Statistics.UserGeoInfo |> ORM.find_by(%{city: "成都"})
15+
{:ok, _} = UserGeoInfo |> ORM.find_by(%{city: "成都"})
1616

1717
{:ok, _} = Statistics.inc_count("成都")
1818

19-
{:ok, updated} = Statistics.UserGeoInfo |> ORM.find_by(%{city: "成都"})
19+
{:ok, updated} = UserGeoInfo |> ORM.find_by(%{city: "成都"})
2020
assert updated.value == 1
2121
{:ok, _} = Statistics.inc_count("成都")
2222

23-
{:ok, updated} = Statistics.UserGeoInfo |> ORM.find_by(%{city: "成都"})
23+
{:ok, updated} = UserGeoInfo |> ORM.find_by(%{city: "成都"})
2424
assert updated.value == 2
2525
end
2626

0 commit comments

Comments
 (0)