1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add last_committer_date and last_author_date for file contents API (#32921)

Fix #32886

Add `last_committer_date` and `last_author_date` in the content API
which is not implemented by Github API v3 at the moment.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao
2025-04-02 21:47:31 -07:00
committed by GitHub
parent c27d87a9ac
commit 45c45934aa
11 changed files with 264 additions and 176 deletions

View File

@@ -4,6 +4,8 @@
package structs
import "time"
// FileOptions options for all file APIs
type FileOptions struct {
// message (optional) for the commit of this file. if not supplied, a default message will be used
@@ -121,6 +123,10 @@ type ContentsResponse struct {
Path string `json:"path"`
SHA string `json:"sha"`
LastCommitSHA string `json:"last_commit_sha"`
// swagger:strfmt date-time
LastCommitterDate time.Time `json:"last_committer_date"`
// swagger:strfmt date-time
LastAuthorDate time.Time `json:"last_author_date"`
// `type` will be `file`, `dir`, `symlink`, or `submodule`
Type string `json:"type"`
Size int64 `json:"size"`