Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/819 Reviewed-by: lewis <747342561@qq.com>pull/829/head
@@ -11,8 +11,9 @@ import ( | |||||
type ContributorWithUserId struct { | type ContributorWithUserId struct { | ||||
git.Contributor | git.Contributor | ||||
UserId int64 | |||||
IsAdmin bool | |||||
UserId int64 | |||||
IsAdmin bool | |||||
RelAvatarLink string | |||||
} | } | ||||
func GetRepoKPIStats(repo *Repository) (*git.RepoKPIStats, error) { | func GetRepoKPIStats(repo *Repository) (*git.RepoKPIStats, error) { | ||||
@@ -146,6 +147,7 @@ func GetTop10Contributor(repoPath string) ([]ContributorWithUserId, error) { | |||||
contributor, | contributor, | ||||
user.ID, | user.ID, | ||||
user.IsAdmin, | user.IsAdmin, | ||||
user.RelAvatarLink(), | |||||
} | } | ||||
} else { | } else { | ||||
@@ -159,6 +161,7 @@ func GetTop10Contributor(repoPath string) ([]ContributorWithUserId, error) { | |||||
contributor, | contributor, | ||||
-1, | -1, | ||||
false, | false, | ||||
"", | |||||
} | } | ||||
} else { | } else { | ||||
value.CommitCnt += contributor.CommitCnt | value.CommitCnt += contributor.CommitCnt | ||||
@@ -31,10 +31,11 @@ type ProjectsPeriodData struct { | |||||
} | } | ||||
type UserInfo struct { | type UserInfo struct { | ||||
User string `json:"user"` | |||||
Mode int `json:"mode"` | |||||
PR int64 `json:"pr"` | |||||
Commit int `json:"commit"` | |||||
User string `json:"user"` | |||||
Mode int `json:"mode"` | |||||
PR int64 `json:"pr"` | |||||
Commit int `json:"commit"` | |||||
RelAvatarLink string `json:"relAvatarLink"` | |||||
} | } | ||||
type ProjectLatestData struct { | type ProjectLatestData struct { | ||||
@@ -316,10 +317,11 @@ func GetProjectLatestStatistics(ctx *context.Context) { | |||||
pr := models.GetPullCountByUserAndRepoId(repoIdInt, contributor.UserId) | pr := models.GetPullCountByUserAndRepoId(repoIdInt, contributor.UserId) | ||||
userInfo := UserInfo{ | userInfo := UserInfo{ | ||||
User: contributor.Committer, | |||||
Commit: contributor.CommitCnt, | |||||
Mode: mode, | |||||
PR: pr, | |||||
User: contributor.Committer, | |||||
Commit: contributor.CommitCnt, | |||||
Mode: mode, | |||||
PR: pr, | |||||
RelAvatarLink: contributor.RelAvatarLink, | |||||
} | } | ||||
users = append(users, userInfo) | users = append(users, userInfo) | ||||