diff --git a/app/controllers/api/v1/statistics_controller.rb b/app/controllers/api/v1/statistics_controller.rb index 67980ff51..c50c79993 100644 --- a/app/controllers/api/v1/statistics_controller.rb +++ b/app/controllers/api/v1/statistics_controller.rb @@ -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 diff --git a/app/serializers/miner_ranking_serializer.rb b/app/serializers/miner_ranking_serializer.rb new file mode 100644 index 000000000..a4c075659 --- /dev/null +++ b/app/serializers/miner_ranking_serializer.rb @@ -0,0 +1,4 @@ +class MinerRankingSerializer + include FastJsonapi::ObjectSerializer + attributes :ranking +end diff --git a/config/routes.rb b/config/routes.rb index 5136e55b0..0d8d0c786 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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