新增:最新提交列表接口

This commit is contained in:
2024-01-30 14:49:54 +08:00
parent feec49d4bd
commit 6a4f63d8ea
5 changed files with 61 additions and 3 deletions

View File

@@ -0,0 +1,13 @@
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']}
end