新增:获取commit列表

This commit is contained in:
2022-07-19 10:41:25 +08:00
parent 6273349334
commit 274cd81655
7 changed files with 543 additions and 238 deletions

View File

@@ -0,0 +1,17 @@
json.total_count @result_object[:total_data].to_i
json.commits @result_object[:data].each do |commit|
json.sha commit['sha']
json.author do
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(commit['commit']['author']), name: commit['commit']['author']['name'] }
end
json.committer do
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(commit['commit']['committer']), name: commit['commit']['committer']['name'] }
end
json.commit_message commit['commit']['message']
json.parent_shas commit['parents'].map{|x|x['sha']}
json.files commit['files'].map{|f|f['filename']}
json.commit_date commit['commit_date']
json.commit_time commit['commit']['committer']['date'].to_time.strftime("%Y-%m-%d %H:%M:%S")
json.branch commit['branch']
end