Files
Website/backend/models/themes_model/model.go
T

39 lines
1.5 KiB
Go

package themes_model
import (
"time"
"autolibrary.top/webserver/backend/models/base_model"
)
type ThemeStatus string
const (
ThemePending ThemeStatus = "pending"
ThemeApproved ThemeStatus = "approved"
ThemeRejected ThemeStatus = "rejected"
)
type Theme struct {
ID uint `json:"id" gorm:"primaryKey"`
Name string `json:"name"`
Author string `json:"author"`
UserID string `json:"userId" gorm:"index"`
NeedTheme string `json:"needTheme" gorm:"type:varchar(10);index"`
Brief string `json:"brief"`
Description string `json:"description"`
Tags base_model.StringArray `json:"tags" gorm:"type:text"`
Status ThemeStatus `json:"status" gorm:"type:varchar(20);index;default:pending"`
FilePath string `json:"-" gorm:"type:text"`
FileSize string `json:"fileSize"`
PreviewURL string `json:"previewUrl"`
DownloadCount uint `json:"downloadCount" gorm:"default:0"`
Version string `json:"version"`
CompatVersion string `json:"compatVersion"`
ReviewedBy string `json:"reviewedBy"`
ReviewComment string `json:"reviewComment"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Verified bool `json:"verified" gorm:"-"`
}