mirror of
https://github.com/go-gitea/gitea
synced 2025-02-05 14:34:27 +00:00
Add last commit when for contents API
This commit is contained in:
parent
5ec8df02f6
commit
6f5bc5923e
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
package structs
|
package structs
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
// FileOptions options for all file APIs
|
// FileOptions options for all file APIs
|
||||||
type FileOptions struct {
|
type FileOptions struct {
|
||||||
// message (optional) for the commit of this file. if not supplied, a default message will be used
|
// 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"`
|
Path string `json:"path"`
|
||||||
SHA string `json:"sha"`
|
SHA string `json:"sha"`
|
||||||
LastCommitSHA string `json:"last_commit_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` will be `file`, `dir`, `symlink`, or `submodule`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Size int64 `json:"size"`
|
Size int64 `json:"size"`
|
||||||
|
@ -182,6 +182,7 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref
|
|||||||
Path: treePath,
|
Path: treePath,
|
||||||
SHA: entry.ID.String(),
|
SHA: entry.ID.String(),
|
||||||
LastCommitSHA: lastCommit.ID.String(),
|
LastCommitSHA: lastCommit.ID.String(),
|
||||||
|
LastCommitWhen: lastCommit.Committer.When,
|
||||||
Size: entry.Size(),
|
Size: entry.Size(),
|
||||||
URL: &selfURLString,
|
URL: &selfURLString,
|
||||||
Links: &api.FileLinksResponse{
|
Links: &api.FileLinksResponse{
|
||||||
|
5
templates/swagger/v1_json.tmpl
generated
5
templates/swagger/v1_json.tmpl
generated
@ -19515,6 +19515,11 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"x-go-name": "LastCommitSHA"
|
"x-go-name": "LastCommitSHA"
|
||||||
},
|
},
|
||||||
|
"last_commit_when": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
|
"x-go-name": "LastCommitWhen"
|
||||||
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"x-go-name": "Name"
|
"x-go-name": "Name"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user