Browse Source

群智熵分析报表接口调整到项目动态接口

pull/342/head
xxq250 3 years ago
parent
commit
558d720203
3 changed files with 6 additions and 6 deletions
  1. +1
    -1
      app/controllers/api/v1/projects/code_stats_controller.rb
  2. +0
    -3
      app/helpers/projects_helper.rb
  3. +5
    -2
      app/views/api/v1/projects/code_stats/index.json.jbuilder

+ 1
- 1
app/controllers/api/v1/projects/code_stats_controller.rb View File

@@ -3,6 +3,6 @@ class Api::V1::Projects::CodeStatsController < Api::V1::BaseController

def index
@result_object = Api::V1::Projects::CodeStats::ListService.call(@project, {ref: params[:ref]}, current_user&.gitea_token)
puts @result_object
# puts @result_object
end
end

+ 0
- 3
app/helpers/projects_helper.rb View File

@@ -66,9 +66,6 @@ module ProjectsHelper
jianmu_devops: jianmu_devops_code(project, user),
jianmu_devops_url: jianmu_devops_url,
cloud_ide_saas_url: cloud_ide_saas_url(user),
ai_shang_v1_url: ai_shang_v1_url(project),
ai_shang_v2_url: ai_shang_v2_url(project),
ai_shang_v3_url: ai_shang_v3_url(project),
ignore_id: project.ignore_id
}).compact



+ 5
- 2
app/views/api/v1/projects/code_stats/index.json.jbuilder View File

@@ -4,11 +4,14 @@ json.change_files @result_object["change_files"]
json.additions @result_object["additions"]
json.deletions @result_object["deletions"]
json.commit_count_in_all_branches @result_object["commit_count_in_all_branches"]
json.authors @result_object["authors"].each do |author|
json.authors @result_object["authors"].each do |author|
json.author do
json.partial! 'api/v1/users/commit_user_email', locals: { user: render_cache_commit_author(author), name: author['name'], email: author['email'] }
end
json.commits author["commits"]
json.additions author["additions"]
json.deletions author["deletions"]
end
end
json.ai_shang_v1_url ai_shang_v1_url(@project)
json.ai_shang_v2_url ai_shang_v2_url(@project)
json.ai_shang_v3_url ai_shang_v3_url(@project)

Loading…
Cancel
Save