Files
qitongxue-api/internal/model/entity/entity_quota_packs.go
2026-09-17 17:38:45 +08:00

28 lines
1.3 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package entity
import "github.com/gogf/gf/v2/os/gtime"
// QuotaPacks 次数包档位(付费额度包)。
//
// 档位标识 pack_key 是跨端契约,与 MP 后台【虚拟支付 → 道具管理】的 ProductId 一一对应。
//
// ToolKey 的语义:
// - 空串 → 通用档位:购买时由用户选择「买给哪个工具」,次数记到该工具名下
// - 非空 → 专属档位:只对该工具出售,可用于给某个工具单独定价
type QuotaPacks struct {
Id int64 `json:"id"`
PackKey string `json:"pack_key"` // 档位标识,如 quota_100
Name string `json:"name"` // 展示名,如 100 次
Times int `json:"times"` // 可用次数
PriceCents int64 `json:"price_cents"` // 价格(分),全链路不换算
ProductId string `json:"product_id"` // 微信虚拟支付道具 ID
ValidDays int `json:"valid_days"` // 有效期天数,默认 365(一年)
ToolKey string `json:"tool_key"` // 绑定工具,空 = 通用档位
Badge string `json:"badge"` // 角标文案,如 最划算
Sort int `json:"sort"`
IsEnabled int `json:"is_enabled"`
Remark string `json:"remark"`
CreatedAt *gtime.Time `json:"created_at"`
UpdatedAt *gtime.Time `json:"updated_at"`
}