获取项目代码目录
GET
/api/{owner}/{repo}/entries.json最后修改时间: 1 年前
请求参数
Path 参数
owner
string
必需
repo
string
必需
Query 参数
ref
string
可选
分支名称、标签名称或是提交标识,默认为master分支
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
last_commit
object
最后一次commit
commit
object
必需
author
object
必需
committer
object
必需
commits_count
integer
commit总数
zip_url
string
zip下载地址
tar_url
string
tar下载地址
entries
array [object {10}]
必需
name
string
文件名称
path
string
文件路径
sha
string
文件标识
type
string
文件类型
file 文件 dir 文件夹 submodule 子模块
submodule_git_url
null
子模块git地址
size
integer
文件大小
is_readme_file
boolean | null
是否为readme文件
content
null
文件内容
target
null
文件标签
commit
object
最近一次提交记录
示例
{
"last_commit": {
"commit": {
"sha": "88801266695966b11fcd95ba2bcefad56750d1d9",
"message": "测试提交\n",
"author": {
"name": "yystopf",
"email": "yystopf@163.com",
"date": "2022-07-19T15:06:40+08:00"
},
"committer": {
"name": "yystopf",
"email": "yystopf@163.com",
"date": "2022-07-19T15:06:40+08:00"
},
"timestamp": 1658214400,
"time_from_now": "1年前"
},
"author": {
"id": "110",
"login": "yystopf",
"name": "咸蛋黄土豆丝xxx",
"type": "User",
"image_url": "system/lets/letter_avatars/2/X/230_139_26/120.png"
},
"committer": {
"id": "110",
"login": "yystopf",
"name": "咸蛋黄土豆丝xxx",
"type": "User",
"image_url": "system/lets/letter_avatars/2/X/230_139_26/120.png"
}
},
"commits_count": 8,
"zip_url": "http://localhost:3000/api/yystopf/ceshi_doc/archive/main.zip",
"tar_url": "http://localhost:3000/api/yystopf/ceshi_doc/archive/main.tar.gz",
"entries": [
{
"name": "heihei7",
"path": "heihei7",
"sha": "f0acac8efb3021b0f6a7b13b42d033d86e076a4b",
"type": "file",
"submodule_git_url": null,
"size": 5,
"is_readme_file": null,
"content": null,
"target": null,
"commit": {
"message": "测试提交\n",
"sha": "88801266695966b11fcd95ba2bcefad56750d1d9",
"created_at": "2022-07-19 15:06",
"time_from_now": "1年前",
"created_at_unix": 1658214400
}
},
{
"name": "README.md",
"path": "README.md",
"sha": "91d1da709ed2610e8bcd7b2f6c988f4b8888e515",
"type": "file",
"submodule_git_url": null,
"size": 13,
"is_readme_file": true,
"content": null,
"target": null,
"commit": {
"message": "Initial commit\n",
"sha": "46556cacf0c652e0a5c52ae2b64fe103ddc5d46e",
"created_at": "2023-11-28 11:47",
"time_from_now": "3小时前",
"created_at_unix": 1701143230
}
}
]
}
最后修改时间: 1 年前