ADD some api

* api/v1/repos/{owner}/{repo}/pulls/{number}/commits
* api/v1/repos/{owner}/{repo}/pulls/{number}/files
* api/v1/repos/{owner}/{repo}/compare/{base}...{head}
This commit is contained in:
Jasder
2020-11-03 18:37:47 +08:00
parent 70f7b59349
commit 2347697e93
15 changed files with 559 additions and 18 deletions

View File

@@ -0,0 +1,13 @@
json.author do
author = User.find_by(login: commit['Author']['Name'])
json.partial! 'repositories/commit_author', locals: { user: author }
end
json.committer do
author = User.find_by(login: commit['Committer']['Name'])
json.partial! 'repositories/commit_author', locals: { user: author }
end
json.timestamp render_unix_time(commit['Committer']['When'])
json.time_from_now time_from_now(commit['Committer']['When'])
json.message commit['CommitMessage']
json.sha commit['Sha']