2021-01-07 14:07:26 +08:00
|
|
|
class StatisticController < ApplicationController
|
|
|
|
|
|
|
|
# 平台概况
|
|
|
|
def platform_profile
|
2022-11-29 14:31:14 +08:00
|
|
|
@platform_user_query = Statistic::PlatformUserQuery.new(params).call rescue [0, 0, 0]
|
|
|
|
@platform_project_query = Statistic::PlatformProjectQuery.new(params).call rescue [0, 0, 0]
|
|
|
|
@platform_course_query = Statistic::PlatformCourseQuery.new(params).call rescue [0, 0, 0]
|
2021-01-07 14:07:26 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
# 平台代码提交数据
|
|
|
|
def platform_code
|
2022-11-29 14:31:14 +08:00
|
|
|
@platform_pull_request_query = Statistic::PlatformPullRequestQuery.new(params).call rescue [0, 0]
|
|
|
|
@platform_commit_query = Statistic::PlatformCommitQuery.new(params,current_user).call rescue [0, 0]
|
2021-01-07 14:07:26 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
# 项目案例活跃度排行榜
|
|
|
|
def active_project_rank
|
2022-11-29 14:31:14 +08:00
|
|
|
@active_project_rank_query = Statistic::ActiveProjectRankQuery.new(params, current_user).call rescue []
|
2021-01-07 14:07:26 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
# 开发者活跃度排行榜
|
|
|
|
def active_developer_rank
|
2022-11-29 14:31:14 +08:00
|
|
|
@active_developer_rank_query = Statistic::ActiveDeveloperRankQuery.new(params, current_user).call rescue []
|
2021-01-07 14:07:26 +08:00
|
|
|
end
|
|
|
|
end
|