修复: blame 响应结构体
This commit is contained in:
parent
a3b1439a52
commit
4a21b9f7ac
|
@ -9,6 +9,13 @@ import (
|
||||||
"code.gitea.io/gitea/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type APIBlameResponse struct {
|
||||||
|
FileSize int64 `json:"file_size"`
|
||||||
|
FileName string `json:"file_name"`
|
||||||
|
NumberLines int `json:"num_lines"`
|
||||||
|
BlameParts []git.ApiBlamePart `json:"blame_parts"`
|
||||||
|
}
|
||||||
|
|
||||||
func GetRepoRefBlame(ctx *context.APIContext) {
|
func GetRepoRefBlame(ctx *context.APIContext) {
|
||||||
// swagger:operation GET /repos/{owner}/{repo}/blame repository repoGetRefBlame
|
// swagger:operation GET /repos/{owner}/{repo}/blame repository repoGetRefBlame
|
||||||
// ---
|
// ---
|
||||||
|
@ -99,8 +106,10 @@ func GetRepoRefBlame(ctx *context.APIContext) {
|
||||||
currentNumber += blamePart.EffectLine
|
currentNumber += blamePart.EffectLine
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
ctx.JSON(http.StatusOK, APIBlameResponse{
|
||||||
"num_lines": numLines,
|
FileSize: blob.Size(),
|
||||||
"blame_parts": blameParts,
|
FileName: blob.Name(),
|
||||||
|
NumberLines: numLines,
|
||||||
|
BlameParts: blameParts,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue