更改: 新增旧版参数
This commit is contained in:
		
							parent
							
								
									6bbb4726f2
								
							
						
					
					
						commit
						8cd17a42f3
					
				|  | @ -17,7 +17,7 @@ class Api::V1::Projects::Pulls::PullsController < Api::V1::BaseController | ||||||
|     if params[:filepath].present?  |     if params[:filepath].present?  | ||||||
|       @result_object = $gitea_hat_client.get_repos_pulls_files_by_owner_repo_index_filepath(@project&.owner.login, @project&.identifier, @pull_request.gitea_number, params[:filepath], {query: {token: current_user&.gitea_token}}) |       @result_object = $gitea_hat_client.get_repos_pulls_files_by_owner_repo_index_filepath(@project&.owner.login, @project&.identifier, @pull_request.gitea_number, params[:filepath], {query: {token: current_user&.gitea_token}}) | ||||||
|     else |     else | ||||||
|       @result_object = $gitea_client.get_repos_pulls_files_by_owner_repo_index(@project&.owner.login, @project&.identifier, @pull_request.gitea_number, {query: {token: current_user&.gitea_token, page: page, limit: limit}}) |       @result_object = $gitea_hat_client.get_repos_pulls_files_by_owner_repo_index(@project&.owner.login, @project&.identifier, @pull_request.gitea_number, {query: {isNew: "true",token: current_user&.gitea_token, page: page, limit: limit}}) | ||||||
|     end |     end | ||||||
|   end  |   end  | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,14 @@ | ||||||
| json.filename file["filename"] | json.filename file["filename"] | ||||||
| json.status file["status"] | json.old_name file["old_name"] | ||||||
|  | json.index file["index"] | ||||||
|  | json.type file["type"] | ||||||
|  | json.is_bin file["is_bin"] | ||||||
|  | json.is_created file["is_created"] | ||||||
|  | json.is_deleted file["is_deleted"] | ||||||
|  | json.is_lfs_file file["is_lfs_file"] | ||||||
|  | json.is_renamed file["is_renamed"] | ||||||
|  | json.is_submodule file["is_submodule"] | ||||||
| json.additions file["additions"] | json.additions file["additions"] | ||||||
| json.deletions file["deletions"] | json.deletions file["deletions"] | ||||||
| json.changes file["changes"] | json.changes file["changes"] | ||||||
|  | json.sha file["sha"] | ||||||
|  | @ -1,8 +1,10 @@ | ||||||
| if params[:filepath].present?  | if params[:filepath].present?  | ||||||
|   json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object |   json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object | ||||||
| else | else | ||||||
|   json.file_numbers @result_object[:total_data].to_i |   json.file_numbers @result_object[:total_data] | ||||||
|   json.files @result_object[:data] do |file| |   json.total_addition @result_object[:data]["total_addition"] | ||||||
|  |   json.total_deletion @result_object[:data]["total_deletion"] | ||||||
|  |   json.files @result_object[:data]["files"] do |file| | ||||||
|     json.partial! "api/v1/projects/simple_gitea_file", file: file |     json.partial! "api/v1/projects/simple_gitea_file", file: file | ||||||
|   end |   end | ||||||
| end | end | ||||||
|  | @ -13,7 +13,9 @@ if params[:filepath].present? | ||||||
|   end |   end | ||||||
| else | else | ||||||
|   json.file_numbers @compare_result[:total_data].to_i |   json.file_numbers @compare_result[:total_data].to_i | ||||||
|   json.files @compare_result[:data] do |file| |   json.total_addition @compare_result[:data]["total_addition"] | ||||||
|  |   json.total_deletion @compare_result[:data]["total_deletion"] | ||||||
|  |   json.files @compare_result[:data]["files"] do |file| | ||||||
|     json.partial! "api/v1/projects/simple_gitea_file", file: file |     json.partial! "api/v1/projects/simple_gitea_file", file: file | ||||||
|   end |   end | ||||||
| end | end | ||||||
|  |  | ||||||
|  | @ -2,7 +2,9 @@ if params[:filepath].present? | ||||||
|   json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object |   json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object | ||||||
| else | else | ||||||
|   json.file_numbers @result_object[:total_data] |   json.file_numbers @result_object[:total_data] | ||||||
|   json.files @result_object[:data] do |file| |   json.total_addition @result_object[:data]["total_addition"] | ||||||
|  |   json.total_deletion @result_object[:data]["total_deletion"] | ||||||
|  |   json.files @result_object[:data]["files"] do |file| | ||||||
|     json.partial! "api/v1/projects/simple_gitea_file", file: file |     json.partial! "api/v1/projects/simple_gitea_file", file: file | ||||||
|   end |   end | ||||||
| end | end | ||||||
		Loading…
	
		Reference in New Issue