Browse Source

Merge pull request '记录仓库名称和是否私有' (#630) from fix-473 into V20211101

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/630
Reviewed-by: lewis <747342561@qq.com>
tags/v1.21.12.1
lewis 4 years ago
parent
commit
4bbc69bb04
2 changed files with 6 additions and 2 deletions
  1. +4
    -2
      models/repo_statistic.go
  2. +2
    -0
      routers/repo/repo_statistic.go

+ 4
- 2
models/repo_statistic.go View File

@@ -9,8 +9,10 @@ import (

// RepoStatistic statistic info of all repository
type RepoStatistic struct {
ID int64 `xorm:"pk autoincr"`
RepoID int64 `xorm:"unique(s) NOT NULL"`
ID int64 `xorm:"pk autoincr"`
RepoID int64 `xorm:"unique(s) NOT NULL"`
Name string `xorm:"INDEX"`
IsPrivate bool
Date string `xorm:"unique(s) NOT NULL"`
NumWatches int64 `xorm:"NOT NULL DEFAULT 0"`
NumWatchesAdded int64 `xorm:"NOT NULL DEFAULT 0"`


+ 2
- 0
routers/repo/repo_statistic.go View File

@@ -89,6 +89,8 @@ func RepoStatisticDaily(date string) {
repoStat := models.RepoStatistic{
RepoID: repo.ID,
Date: date,
Name: repo.Name,
IsPrivate: repo.IsPrivate,
NumWatches: int64(repo.NumWatches),
NumStars: int64(repo.NumStars),
NumDownloads: repo.CloneCnt,


Loading…
Cancel
Save