mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-20 11:45:57 +08:00
新增:最新提交列表接口
This commit is contained in:
13
app/views/api/v1/projects/commits/recent.json.jbuilder
Normal file
13
app/views/api/v1/projects/commits/recent.json.jbuilder
Normal 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
|
||||
Reference in New Issue
Block a user