From 133713ae7f575214bc883ac4b162412e73ebf3e7 Mon Sep 17 00:00:00 2001 From: yystopf Date: Sun, 26 Sep 2021 11:36:34 +0800 Subject: [PATCH] add: tag created at unix --- app/docs/slate/source/includes/_repositories.md | 6 ++++++ app/views/repositories/tags.json.jbuilder | 2 ++ public/docs/api.html | 14 ++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/app/docs/slate/source/includes/_repositories.md b/app/docs/slate/source/includes/_repositories.md index 9669d456a..642a4cc34 100644 --- a/app/docs/slate/source/includes/_repositories.md +++ b/app/docs/slate/source/includes/_repositories.md @@ -308,11 +308,13 @@ await octokit.request('GET /api/yystopf/csfjkkj/tags.json') |tarball_url |string|标签tar包下载地址| |tagger |object|打标签的人| |time_ago |string|打标签的时间| +|created_at_unix|string|打标签的时间戳| |message |string|标签信息| |commit |object|标签最后一个commit| |commit.sha |string|commit的id| |commit.message |string|commit的提交信息| |commit.time_ago|string|commit的提交时间| +|commit.created_at_unix|string|commit的提交时间戳| |commit.commiter|object|commit的提交者| |commit.author|object|commit的作者| @@ -333,11 +335,13 @@ await octokit.request('GET /api/yystopf/csfjkkj/tags.json') "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png" }, "time_ago": "1天前", + "created_at_unix": 1632376903, "message": "jdfkls", "commit": { "sha": "08fe383f1e5ebe2e2a384a8ea3ee890a758c7cd7", "message": "add\n", "time_ago": "1天前", + "created_at_unix": 1632376186, "committer": { "id": 4, "login": "testforge1", @@ -364,11 +368,13 @@ await octokit.request('GET /api/yystopf/csfjkkj/tags.json') "image_url": "system/lets/letter_avatars/2/V/39_141_222/120.png" }, "time_ago": "10天前", + "created_at_unix": 1631588042, "message": "dfks", "commit": { "sha": "5291b5e45a377c1f7710cc6647259887ed7aaccf", "message": "ADD file via upload\n", "time_ago": "21天前", + "created_at_unix": 1630648417, "committer": { "id": null, "login": "yystopf", diff --git a/app/views/repositories/tags.json.jbuilder b/app/views/repositories/tags.json.jbuilder index 2feab91ed..d1ee3671e 100644 --- a/app/views/repositories/tags.json.jbuilder +++ b/app/views/repositories/tags.json.jbuilder @@ -8,11 +8,13 @@ json.array! @tags do |tag| json.partial! 'commit_author', user: render_commit_author(tag['tagger']), name: tag['tagger']['name'] end json.time_ago time_from_now(tag['tagger']['date'].to_time) + json.created_at_unix tag['tagger']['date'].to_time.to_i json.message tag['message'] json.commit do json.sha tag['commit']['sha'] json.message tag['commit']['message'] json.time_ago time_from_now(tag['commit']['commiter']['date'].to_time) + json.created_at_unix tag['commit']['commiter']['date'].to_time.to_i json.committer do json.partial! 'commit_author', user: render_commit_author(tag['commit']['commiter']), name: tag['commit']['commiter']['name'] end diff --git a/public/docs/api.html b/public/docs/api.html index 33f9e72b7..fc9427033 100644 --- a/public/docs/api.html +++ b/public/docs/api.html @@ -6276,6 +6276,11 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat 打标签的时间 +created_at_unix +string +打标签的时间戳 + + message string 标签信息 @@ -6301,6 +6306,11 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat commit的提交时间 +commit.created_at_unix +string +commit的提交时间戳 + + commit.commiter object commit的提交者 @@ -6328,11 +6338,13 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png" }, "time_ago": "1天前", + "created_at_unix": 1632376903, "message": "jdfkls", "commit": { "sha": "08fe383f1e5ebe2e2a384a8ea3ee890a758c7cd7", "message": "add\n", "time_ago": "1天前", + "created_at_unix": 1632376186, "committer": { "id": 4, "login": "testforge1", @@ -6359,11 +6371,13 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat "image_url": "system/lets/letter_avatars/2/V/39_141_222/120.png" }, "time_ago": "10天前", + "created_at_unix": 1631588042, "message": "dfks", "commit": { "sha": "5291b5e45a377c1f7710cc6647259887ed7aaccf", "message": "ADD file via upload\n", "time_ago": "21天前", + "created_at_unix": 1630648417, "committer": { "id": null, "login": "yystopf",