Skip to content

Commit

Permalink
feat(server): implement miner ranking api
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Jun 24, 2019
1 parent 124b35b commit a765623
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/controllers/api/v1/statistics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ def index
statistic_info = StatisticInfo.new
render json: IndexStatisticSerializer.new(statistic_info)
end

def show
ranking = MinerRanking.new
render json: MinerRankingSerializer.new(ranking)
end
end
end
end
4 changes: 4 additions & 0 deletions app/serializers/miner_ranking_serializer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class MinerRankingSerializer
include FastJsonapi::ObjectSerializer
attributes :ranking
end
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
resources :cell_output_type_scripts, only: :show
resources :cell_output_data, only: :show
resources :suggest_queries, only: :index
resources :statistics, only: :index
resources :statistics, only: %i(index show)
end
end
end

0 comments on commit a765623

Please sign in to comment.