change the api of getPushInfo
This commit is contained in:
parent
f59d3f5114
commit
5bbec0b311
app/api/mobile/apis
|
@ -77,8 +77,7 @@ module Mobile
|
|||
params do
|
||||
requires :username, type: String
|
||||
requires :password, type: String
|
||||
requires :newHash, type: String
|
||||
requires :oldHash, type: String
|
||||
requires :shaList, type: Array
|
||||
requires :branch, type: String
|
||||
requires :ownername, type: String
|
||||
requires :reponame, type: String
|
||||
|
@ -90,8 +89,14 @@ module Mobile
|
|||
project = Project.find_by_user_id_name(owner.id, params[:reponame])
|
||||
if project
|
||||
g = Gitlab.client # 用于通过gitlab api进行查询
|
||||
diff_result = g.commit_diff(project.gpid, params[:oldHash])
|
||||
{status:0, diff_result:diff_result}
|
||||
result = []
|
||||
for i in 0..params[:shaList].length
|
||||
sha = params[:shaList][i]
|
||||
Rails.logger.info sha
|
||||
commit = g.commit(project.gpid, sha)
|
||||
result << commit
|
||||
end
|
||||
{status:0, result:result}
|
||||
else
|
||||
Rails.logger.info "project not found"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue