2025-11-24 18:44:06 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"platform/web/core"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// Resource 套餐表
|
|
|
|
|
|
type Resource struct {
|
|
|
|
|
|
core.Model
|
|
|
|
|
|
UserID int32 `json:"user_id" gorm:"column:user_id"` // 用户ID
|
|
|
|
|
|
ResourceNo *string `json:"resource_no" gorm:"column:resource_no"` // 套餐编号
|
|
|
|
|
|
Active bool `json:"active" gorm:"column:active"` // 套餐状态
|
|
|
|
|
|
Type ResourceType `json:"type" gorm:"column:type"` // 套餐类型:1-短效动态,2-长效动态
|
|
|
|
|
|
|
2025-12-08 14:22:30 +08:00
|
|
|
|
User *User `json:"user,omitempty" gorm:"foreignKey:UserID"`
|
|
|
|
|
|
Short *ResourceShort `json:"short,omitempty" gorm:"foreignKey:ResourceID"`
|
|
|
|
|
|
Long *ResourceLong `json:"long,omitempty" gorm:"foreignKey:ResourceID"`
|
2025-11-24 18:44:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ResourceType 套餐类型枚举
|
|
|
|
|
|
type ResourceType int
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
|
ResourceTypeShort ResourceType = 1 // 短效动态
|
|
|
|
|
|
ResourceTypeLong ResourceType = 2 // 长效动态
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// ResourceLongType 套餐计费模式枚举
|
|
|
|
|
|
type ResourceMode int
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
|
ResourceModeTime ResourceMode = 1 // 包时
|
|
|
|
|
|
ResourceModeQuota ResourceMode = 2 // 包量
|
|
|
|
|
|
)
|