Add internal/model/app.go
This commit is contained in:
41
internal/model/app.go
Normal file
41
internal/model/app.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// AppCategory 应用分类
|
||||
type AppCategory 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"`
|
||||
}
|
||||
|
||||
// App 应用模型(3 套应用网站共用同一套数据)
|
||||
type App struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"size:200;not null" json:"name"`
|
||||
Description string `gorm:"type:text" json:"description"`
|
||||
CategoryID uint `gorm:"index" json:"category_id"`
|
||||
CategoryName string `gorm:"size:50" json:"category_name"`
|
||||
Icon string `gorm:"size:255" json:"icon"` // 应用图标URL
|
||||
Developer string `gorm:"size:100" json:"developer"` // 开发者
|
||||
Rating float64 `gorm:"type:decimal(2,1);default:5.0" json:"rating"`
|
||||
Reviews int `gorm:"default:0" json:"reviews"` // 评价数
|
||||
Downloads int `gorm:"default:0" json:"downloads"` // 下载量
|
||||
Size string `gorm:"size:50" json:"size"` // 应用大小
|
||||
Version string `gorm:"size:50" json:"version"` // 版本号
|
||||
UpdateDate string `gorm:"size:20" json:"update_date"` // 更新日期
|
||||
Platform string `gorm:"size:100" json:"platform"` // 平台
|
||||
Price string `gorm:"size:50" json:"price"` // 价格(免费/付费)
|
||||
Tags string `gorm:"type:text" json:"tags"` // JSON: 标签数组
|
||||
Screenshots string `gorm:"type:text" json:"screenshots"` // JSON: 截图描述数组
|
||||
Features string `gorm:"type:text" json:"features"` // JSON: 特性列表
|
||||
IsFeatured bool `gorm:"default:false" json:"is_featured"` // 精选
|
||||
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"`
|
||||
}
|
||||
Reference in New Issue
Block a user