mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-20 11:45:57 +08:00
新增: blobs和文件树接口及文档
This commit is contained in:
4
app/views/api/v1/projects/git/blobs.json.jbuilder
Normal file
4
app/views/api/v1/projects/git/blobs.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.sha @result_object['sha']
|
||||
json.size @result_object['size']
|
||||
json.encoding @result_object['encoding']
|
||||
json.content @result_object['content']
|
||||
9
app/views/api/v1/projects/git/trees.json.jbuilder
Normal file
9
app/views/api/v1/projects/git/trees.json.jbuilder
Normal file
@@ -0,0 +1,9 @@
|
||||
json.total_count @result_object['total_count']
|
||||
json.sha @result_object['sha']
|
||||
json.entries @result_object['tree'].each do |entry|
|
||||
json.name entry['path']
|
||||
json.mode entry['mode']
|
||||
json.type entry['type'] === 'blob' ? 'file' : 'dir'
|
||||
json.size entry['size']
|
||||
json.sha entry['sha']
|
||||
end
|
||||
Reference in New Issue
Block a user