Files
blind-select/backend/internal/model/package.go
T
admin 06488f0237 Initial commit: 帮我选盲选应用
功能:
- Go后端 (Gin + GORM + PostgreSQL)
- UniApp用户端 (iOS/Android/小程序)
- DaisyUI5后台管理
- JWT认证 + 微信登录
- 盲选加权算法
- 会员系统 + 优惠券
- 打分评价 + 偏好学习
2026-06-08 20:18:31 +00:00

30 lines
1.0 KiB
Go

package model
import (
"time"
"gorm.io/gorm"
)
type Package struct {
ID uint `gorm:"primaryKey" json:"id"`
MerchantID uint `json:"merchant_id"`
CategoryID uint `json:"category_id"`
Name string `gorm:"size:200" json:"name"`
Description string `gorm:"type:text" json:"description"`
PriceMin int `json:"price_min"`
PriceMax int `json:"price_max"`
ActualPrice int `json:"actual_price"`
Tags string `gorm:"type:text[]" json:"tags"`
Stock int `gorm:"default:9999" json:"stock"`
Weight float64 `gorm:"default:1.0" json:"weight"`
Rating float64 `gorm:"default:0" json:"rating"`
ReviewCount int `gorm:"default:0" json:"review_count"`
Status string `gorm:"size:20;default:active" json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
func (Package) TableName() string { return "packages" }