Files
sundynix-plant-be/model/plant/exchange_item.go
T

29 lines
1.6 KiB
Go

package plant
import (
"sundynix-go/global"
"sundynix-go/model/system"
"time"
)
// ExchangeItem 兑换商品
type ExchangeItem struct {
global.BaseModel
Name string `json:"name" gorm:"size:100;not null;column:name"` // 商品名称
Description string `json:"description" gorm:"type:text;column:description"` // 商品描述
ImageId string `json:"imageId" gorm:"size:50;column:image_id"` // 商品图片ID
Type string `json:"type" gorm:"size:20;not null;default:PHYSICAL;column:type"` // 商品类型: PHYSICAL/VIRTUAL/COUPON
CostSunlight int64 `json:"costSunlight" gorm:"not null;default:0;column:cost_sunlight"` // 消耗阳光值
Stock int `json:"stock" gorm:"not null;default:-1;column:stock"` // 库存 -1无限
LimitPerUser int `json:"limitPerUser" gorm:"not null;default:0;column:limit_per_user"` // 每人限兑次数 0不限
Status int `json:"status" gorm:"not null;default:1;column:status"` // 1上架 2下架
Sort int `json:"sort" gorm:"not null;default:0;column:sort"` // 排序
StartTime *time.Time `json:"startTime" gorm:"column:start_time"` // 上架时间
EndTime *time.Time `json:"endTime" gorm:"column:end_time"` // 下架时间
Image *system.Oss `json:"image" gorm:"foreignKey:ImageId"` // 商品图片关联
}
func (ExchangeItem) TableName() string {
return "sundynix_exchange_item"
}