mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
新增: pr版本列表和diff接口
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
json.name file['Name']
|
||||
json.oldname file['OldName']
|
||||
json.addition file['Addition']
|
||||
json.deletion file['Deletion']
|
||||
json.type file['Type']
|
||||
json.is_created file['IsCreated']
|
||||
json.is_deleted file['IsDeleted']
|
||||
json.is_bin file['IsBin']
|
||||
json.is_lfs_file file['IsLFSFile']
|
||||
json.is_renamed file['IsRenamed']
|
||||
json.is_ambiguous file['IsAmbiguous']
|
||||
json.is_submodule file['IsSubmodule']
|
||||
json.sections file['Sections'] do |section|
|
||||
json.file_name section['FileName']
|
||||
json.name section['Name']
|
||||
json.lines section['Lines'] do |line|
|
||||
json.left_index line['LeftIdx']
|
||||
json.right_index line['RightIdx']
|
||||
json.match line['Match']
|
||||
json.type line['Type']
|
||||
json.content line['Content']
|
||||
unless line['SectionInfo'].blank?
|
||||
json.section_path line['SectionInfo']['Path']
|
||||
json.section_last_left_index line['SectionInfo']['LastLeftIdx']
|
||||
json.section_last_right_index line['SectionInfo']['LastRightIdx']
|
||||
json.section_left_index line['SectionInfo']['LeftIdx']
|
||||
json.section_right_index line['SectionInfo']['RightIdx']
|
||||
json.section_left_hunk_size line['SectionInfo']['LeftHunkSize']
|
||||
json.section_right_hunk_size line['SectionInfo']['RightHunkSize']
|
||||
end
|
||||
end
|
||||
end
|
||||
json.is_incomplete file['IsIncomplete']
|
||||
json.is_incomplete_line_too_long file['IsIncompleteLineTooLong']
|
||||
json.is_protected file['IsProtected']
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
if @result_object.has_key?("NumFiles")
|
||||
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object
|
||||
else
|
||||
json.partial! "api/v1/projects/simple_gitea_diff_file_detail", file: @result_object
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
json.total_count @result_object[:total_data].to_i
|
||||
json.versions @result_object[:data].each do |version|
|
||||
json.id version['id']
|
||||
json.add_line_num version['add_line_num']
|
||||
json.del_line_num version['del_line_num']
|
||||
json.commits_count version['commits_count']
|
||||
json.files_count version['files_count']
|
||||
json.base_commit_sha version['base_commit_sha']
|
||||
json.head_commit_sha version['head_commit_sha']
|
||||
json.start_commit_sha version['start_commit_sha']
|
||||
json.created_time render_unix_time(version['created_at'])
|
||||
json.updated_time render_unix_time(version['updated_at'])
|
||||
end
|
||||
Reference in New Issue
Block a user