feat: 去掉 Feed 顶栏统计并强化开源码桶

按帖子列表风格展示码桶,补齐语言/Star/Fork 与论坛作者关联回填,避免未绑定仓库与空列表。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-28 03:58:04 +08:00
parent d929bf96aa
commit 012cac23de
11 changed files with 486 additions and 172 deletions

View File

@@ -4,19 +4,22 @@ import "time"
// GiteaRepo 从 Gitea 同步的公开仓库缓存(侧栏 /projects 读取)
type GiteaRepo struct {
ID uint `gorm:"primaryKey" json:"id"`
GiteaID int64 `gorm:"uniqueIndex;not null" json:"gitea_id"`
OwnerLogin string `gorm:"size:128;not null;index" json:"owner_login"`
Name string `gorm:"size:255;not null" json:"name"`
FullName string `gorm:"size:512;not null" json:"full_name"`
Description string `gorm:"size:2048;default:''" json:"description"`
HTMLURL string `gorm:"size:1024;not null" json:"html_url"`
Private bool `gorm:"default:false" json:"private"`
UpdatedAtRemote *time.Time `json:"updated_at_remote"`
ForumUserID *uint `gorm:"index" json:"forum_user_id"`
SyncedAt time.Time `json:"synced_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ID uint `gorm:"primaryKey" json:"id"`
GiteaID int64 `gorm:"uniqueIndex;not null" json:"gitea_id"`
OwnerLogin string `gorm:"size:128;not null;index" json:"owner_login"`
Name string `gorm:"size:255;not null" json:"name"`
FullName string `gorm:"size:512;not null" json:"full_name"`
Description string `gorm:"size:2048;default:''" json:"description"`
HTMLURL string `gorm:"size:1024;not null" json:"html_url"`
Language string `gorm:"size:64;default:''" json:"language"`
StarsCount int `gorm:"default:0" json:"stars_count"`
ForksCount int `gorm:"default:0" json:"forks_count"`
Private bool `gorm:"default:false" json:"private"`
UpdatedAtRemote *time.Time `json:"updated_at_remote"`
ForumUserID *uint `gorm:"index" json:"forum_user_id"`
SyncedAt time.Time `json:"synced_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (GiteaRepo) TableName() string {