change function name to getCommitInfo and return list of true or false

This commit is contained in:
nigel007 2019-05-26 16:12:39 +08:00
parent 49eb0cf73a
commit f2d403cc43
1 changed files with 9 additions and 5 deletions

View File

@ -69,7 +69,7 @@ module Mobile
{status:-1, message: '该项目不存在' }
end
else
{status:-1, message: '该项目不存在或已被删除' }
{status:-1, message: '该项目不存在或已被删除' }
end
end
@ -82,7 +82,7 @@ module Mobile
requires :ownername, type: String
requires :reponame, type: String
end
post 'getPushInfo' do
post 'getCommitInfo' do
authenticate!
owner = User.find_by_login(params[:ownername])
if owner
@ -95,14 +95,18 @@ module Mobile
sha = params[:shaList][i]
Rails.logger.info sha
commit = g.commit(project.gpid, sha)
result << commit
if commit
result << true
else
result << false
end
end
{status:0, result:result}
else
Rails.logger.info "project not found"
{status:1, message: '该项目不存在或已被删除' }
end
else
Rails.logger.info "owner not found"
{status:1, message: '该项目不存在或已被删除' }
end
end