Files
web_template/internal/model/music.go
2026-09-09 02:39:57 +08:00

38 lines
1.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import "time"
// MusicCategory 音乐分类(曲风)
type MusicCategory struct {
ID uint `gorm:"primaryKey" json:"id"`
Name string `gorm:"size:50;not null" json:"name"`
Icon string `gorm:"size:50" json:"icon"`
Sort int `gorm:"default:0" json:"sort"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// Song 歌曲模型(3 套音乐网站共用同一套数据)
type Song struct {
ID uint `gorm:"primaryKey" json:"id"`
Title string `gorm:"size:200;not null" json:"title"` // 歌曲名
Artist string `gorm:"size:100;not null" json:"artist"` // 歌手
Album string `gorm:"size:200" json:"album"` // 专辑
CategoryID uint `gorm:"index" json:"category_id"`
CategoryName string `gorm:"size:50" json:"category_name"` // 曲风
Cover string `gorm:"size:255" json:"cover"` // 封面URL
Duration int `gorm:"default:0" json:"duration"` // 时长(秒)
PlayCount int `gorm:"default:0" json:"play_count"` // 播放量
LikeCount int `gorm:"default:0" json:"like_count"` // 收藏量
Lyrics string `gorm:"type:text" json:"lyrics"` // 歌词
ReleaseDate string `gorm:"size:20" json:"release_date"` // 发行日期
Language string `gorm:"size:50" json:"language"` // 语种
Tags string `gorm:"type:text" json:"tags"` // JSON: 标签数组
IsHot bool `gorm:"default:false" json:"is_hot"` // 热门
IsNew bool `gorm:"default:false" json:"is_new"` // 新歌
Sort int `gorm:"default:0" json:"sort"`
Status int `gorm:"default:1;not null" json:"status"` // 1=上架
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}