68 lines
2.9 KiB
Go
68 lines
2.9 KiB
Go
package models
|
|
|
|
import "go.mongodb.org/mongo-driver/v2/bson"
|
|
|
|
// Site 站点
|
|
type Site struct {
|
|
ID bson.ObjectID `bson:"_id,omitempty" json:"id"`
|
|
Name string `bson:"name" json:"name"`
|
|
Domain string `bson:"domain" json:"domain"`
|
|
Description string `bson:"description,omitempty" json:"description,omitempty"`
|
|
CreatedAt string `bson:"created_at" json:"created_at"`
|
|
}
|
|
|
|
// Page 网页(属于某站点)
|
|
type Page struct {
|
|
ID bson.ObjectID `bson:"_id,omitempty" json:"id"`
|
|
SiteID string `bson:"site_id" json:"site_id"`
|
|
Slug string `bson:"slug" json:"slug"` // index, about, ...
|
|
Title string `bson:"title" json:"title"`
|
|
Type string `bson:"type" json:"type"` // homepage, page
|
|
Content string `bson:"content" json:"content"` // HTML 或 JSON 字符串
|
|
UpdatedAt string `bson:"updated_at" json:"updated_at"`
|
|
}
|
|
|
|
// HomepageData 首页可编辑数据(与 yuheng-download-space 对应)
|
|
type HomepageData struct {
|
|
LogoText string `json:"logo_text"` // YUHENG ONE
|
|
NavLinks []NavLink `json:"nav_links"` // MISSION, DOWNLOAD, CONTACT
|
|
Title string `json:"title"` // 宇恒一号
|
|
Subtitle string `json:"subtitle"` // INTERSTELLAR EXPLORER EDITION
|
|
Description string `json:"description"` // 跨越星际的智能伙伴...
|
|
DownloadText string `json:"download_text"` // START EXPLORING
|
|
DownloadURL string `json:"download_url"` // #
|
|
Platforms []PlatformItem `json:"platforms"` // Windows, macOS, ...
|
|
Version string `json:"version"` // VERSION 3.2.1
|
|
LaunchYear string `json:"launch_year"` // LAUNCH: 2024
|
|
BadgeText string `json:"badge_text"` // FREE ACCESS
|
|
Features []FeatureItem `json:"features"` // 星际导航等
|
|
FooterText string `json:"footer_text"` // © 2024 YUHENG ONE
|
|
}
|
|
|
|
type NavLink struct {
|
|
Label string `json:"label"`
|
|
URL string `json:"url"`
|
|
}
|
|
|
|
type PlatformItem struct {
|
|
Name string `json:"name"` // WINDOWS, MACOS, ...
|
|
URL string `json:"url"`
|
|
}
|
|
|
|
type FeatureItem struct {
|
|
Title string `json:"title"`
|
|
Desc string `json:"desc"`
|
|
}
|
|
|
|
// SiteAsset 站点功能模块/上传文件
|
|
type SiteAsset struct {
|
|
ID bson.ObjectID `bson:"_id,omitempty" json:"id"`
|
|
SiteID string `bson:"site_id" json:"site_id"`
|
|
Name string `bson:"name" json:"name"`
|
|
FilePath string `bson:"file_path" json:"file_path"` // 相对路径,可含多级目录
|
|
Size int64 `bson:"size" json:"size"`
|
|
ContentType string `bson:"content_type" json:"content_type"`
|
|
Downloadable bool `bson:"downloadable" json:"downloadable"` // 是否允许下载
|
|
CreatedAt string `bson:"created_at" json:"created_at"`
|
|
}
|