2025-11-24 18:44:06 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"time"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// ResourceLong 长效动态套餐表
|
|
|
|
|
|
type ResourceLong struct {
|
2025-12-15 14:48:30 +08:00
|
|
|
|
ID int32 `json:"id" gorm:"column:id"` // ID
|
|
|
|
|
|
ResourceID int32 `json:"resource_id" gorm:"column:resource_id"` // 套餐ID
|
2026-03-24 16:25:21 +08:00
|
|
|
|
Code string `json:"code" gorm:"column:code"` // 套餐编码
|
2025-12-15 14:48:30 +08:00
|
|
|
|
Live int32 `json:"live" gorm:"column:live"` // 可用时长(小时)
|
|
|
|
|
|
Type ResourceMode `json:"type" gorm:"column:type"` // 套餐类型:1-包时,2-包量
|
|
|
|
|
|
Quota int32 `json:"quota" gorm:"column:quota"` // 每日配额(包时)或总配额(包量)
|
|
|
|
|
|
ExpireAt *time.Time `json:"expire_at,omitempty" gorm:"column:expire_at"` // 套餐过期时间,包时模式可用
|
|
|
|
|
|
Used int32 `json:"used" gorm:"column:used"` // 总用量
|
|
|
|
|
|
Daily int32 `json:"daily" gorm:"column:daily"` // 当日用量
|
|
|
|
|
|
LastAt *time.Time `json:"last_at,omitempty" gorm:"column:last_at"` // 最后使用时间
|
2026-03-24 16:25:21 +08:00
|
|
|
|
|
|
|
|
|
|
Sku *ProductSku `json:"sku,omitempty" gorm:"foreignKey:Code;references:Code"`
|
2025-11-24 18:44:06 +08:00
|
|
|
|
}
|