mirror of
https://github.com/go-gitea/gitea
synced 2025-01-27 10:04:28 +00:00
Add last commit when for contents API
This commit is contained in:
parent
5ec8df02f6
commit
6f5bc5923e
@ -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,8 @@ type ContentsResponse struct {
|
||||
Path string `json:"path"`
|
||||
SHA string `json:"sha"`
|
||||
LastCommitSHA string `json:"last_commit_sha"`
|
||||
// swagger:strfmt date-time
|
||||
LastCommitWhen time.Time `json:"last_commit_when"`
|
||||
// `type` will be `file`, `dir`, `symlink`, or `submodule`
|
||||
Type string `json:"type"`
|
||||
Size int64 `json:"size"`
|
||||
|
@ -182,6 +182,7 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref
|
||||
Path: treePath,
|
||||
SHA: entry.ID.String(),
|
||||
LastCommitSHA: lastCommit.ID.String(),
|
||||
LastCommitWhen: lastCommit.Committer.When,
|
||||
Size: entry.Size(),
|
||||
URL: &selfURLString,
|
||||
Links: &api.FileLinksResponse{
|
||||
|
5
templates/swagger/v1_json.tmpl
generated
5
templates/swagger/v1_json.tmpl
generated
@ -19515,6 +19515,11 @@
|
||||
"type": "string",
|
||||
"x-go-name": "LastCommitSHA"
|
||||
},
|
||||
"last_commit_when": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"x-go-name": "LastCommitWhen"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"x-go-name": "Name"
|
||||
|
Loading…
x
Reference in New Issue
Block a user