mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #67
This commit is contained in:
+14
-13
@@ -51,23 +51,24 @@ type Article struct {
|
||||
GalleryAlbumID string `json:"gallery_album_id"`
|
||||
GalleryAlbumURL string `json:"gallery_album_url"`
|
||||
// Stored as JSON string or comma-separated list; frontend normalizes
|
||||
GalleryPhotoIDs string `gorm:"type:text" json:"gallery_photo_ids"`
|
||||
// YouTube video association (optional)
|
||||
YouTubeVideoID string `json:"youtube_video_id"`
|
||||
YouTubeVideoTitle string `gorm:"type:text" json:"youtube_video_title"`
|
||||
YouTubeVideoURL string `json:"youtube_video_url"`
|
||||
YouTubeVideoThumbnail string `json:"youtube_video_thumbnail"`
|
||||
// Match link (loaded separately, not stored in this table)
|
||||
MatchLink *ArticleMatchLink `gorm:"-" json:"match_link,omitempty"`
|
||||
GalleryPhotoIDs string `gorm:"type:text" json:"gallery_photo_ids"`
|
||||
// YouTube video association (optional)
|
||||
YouTubeVideoID string `json:"youtube_video_id"`
|
||||
YouTubeVideoTitle string `gorm:"type:text" json:"youtube_video_title"`
|
||||
YouTubeVideoURL string `json:"youtube_video_url"`
|
||||
YouTubeVideoThumbnail string `json:"youtube_video_thumbnail"`
|
||||
// Match link (loaded separately, not stored in this table)
|
||||
// Removed omitempty to always include in JSON (even if null)
|
||||
MatchLink *ArticleMatchLink `gorm:"-" json:"match_link"`
|
||||
}
|
||||
|
||||
// ArticleTeamLink represents a link from an article to a team identified by an external FACR ID
|
||||
type ArticleTeamLink struct {
|
||||
gorm.Model
|
||||
ArticleID uint `gorm:"not null;index" json:"article_id"`
|
||||
Article Article `gorm:"foreignKey:ArticleID" json:"-"`
|
||||
ExternalTeamID string `gorm:"not null;index" json:"external_team_id"`
|
||||
TeamName string `json:"team_name"`
|
||||
gorm.Model
|
||||
ArticleID uint `gorm:"not null;index" json:"article_id"`
|
||||
Article Article `gorm:"foreignKey:ArticleID" json:"-"`
|
||||
ExternalTeamID string `gorm:"not null;index" json:"external_team_id"`
|
||||
TeamName string `json:"team_name"`
|
||||
}
|
||||
|
||||
func (ArticleTeamLink) TableName() string { return "article_team_links" }
|
||||
|
||||
Reference in New Issue
Block a user