From 56c1caafddc9ee0352d362d1d0082764a8896cf8 Mon Sep 17 00:00:00 2001 From: ata <17314593+asdxzaaaaa@user.noreply.gitee.com> Date: Fri, 10 Jul 2026 10:06:09 +0000 Subject: [PATCH] Add internal/model/app.go --- internal/model/app.go | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 internal/model/app.go diff --git a/internal/model/app.go b/internal/model/app.go new file mode 100644 index 0000000..3e623ce --- /dev/null +++ b/internal/model/app.go @@ -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"` +}