mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-17 10:15:57 +08:00
新增: 批量更改文件
This commit is contained in:
@@ -12,9 +12,9 @@ json.blame_parts @result_object['blame_parts'] do |part|
|
||||
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(part['commit']['commiter']), name: part['commit']['commiter']['Name'] }
|
||||
end
|
||||
json.commit_message part['commit']['commit_message']
|
||||
json.authored_time part['commit']['authored_time'].to_time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
json.committed_time part['commit']['committed_time'].to_time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
json.created_time part['commit']['created_time'].to_time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
json.authored_time render_unix_time(part['commit']['authored_time'])
|
||||
json.committed_time render_unix_time(part['commit']['committed_time'])
|
||||
json.created_time render_unix_time(part['commit']['created_time'])
|
||||
end
|
||||
json.current_number part['current_number']
|
||||
json.effect_line part['effect_line']
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
json.sha commit['sha']
|
||||
json.author do
|
||||
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(commit['author']), name: commit['author']['name'] }
|
||||
end
|
||||
|
||||
json.committer do
|
||||
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(commit['committer']), name: commit['committer']['name'] }
|
||||
end
|
||||
json.commit_message commit['message']
|
||||
json.parent_shas commit['parents'].map{|x|x['sha']}
|
||||
@@ -12,6 +12,6 @@ json.commits @result_object[:data].each do |commit|
|
||||
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.commit_time render_unix_time(commit['commit']['committer']['date'])
|
||||
json.branch commit['branch']
|
||||
end
|
||||
14
app/views/api/v1/projects/contents/batch.json.jbuilder
Normal file
14
app/views/api/v1/projects/contents/batch.json.jbuilder
Normal file
@@ -0,0 +1,14 @@
|
||||
json.commit do
|
||||
json.partial! "api/v1/projects/commits/simple_gitea_detail", commit: @result_object['commit']
|
||||
json.authored_time render_unix_time(@result_object['commit']['author']['date'])
|
||||
json.commited_time render_unix_time(@result_object['commit']['committer']['date'])
|
||||
end
|
||||
json.contents @result_object['contents'].each do |content|
|
||||
json.name content['name']
|
||||
json.path content['path']
|
||||
json.sha content['sha']
|
||||
json.type content['type']
|
||||
json.size content['size']
|
||||
json.encoding content['encoding']
|
||||
json.content content['content']
|
||||
end
|
||||
Reference in New Issue
Block a user