代码初始化

This commit is contained in:
2026-04-02 10:22:36 +08:00
commit 7394983236
35 changed files with 3014 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
package knapsack
// KnapsackActionType 背包操作类型
type KnapsackActionType string
const (
KnapsackActionCreate KnapsackActionType = "create" // 创建
KnapsackActionUse KnapsackActionType = "use" // 使用
KnapsackActionVerify KnapsackActionType = "verify" // 核销
KnapsackActionList KnapsackActionType = "list" // 上架
KnapsackActionUnlist KnapsackActionType = "unlist" // 下架
KnapsackActionExpire KnapsackActionType = "expire" // 过期
)

View File

@@ -0,0 +1,28 @@
package knapsack
// KnapsackAssetType 背包资产类型
type KnapsackAssetType string
const (
KnapsackAssetTypePhysical KnapsackAssetType = "physical" // 实物资产
KnapsackAssetTypeVirtual KnapsackAssetType = "virtual" // 虚拟资产
KnapsackAssetTypeService KnapsackAssetType = "service" // 服务资产
)
// ServiceAssetType 服务资产子类型
type ServiceAssetType string
const (
ServiceAssetTypeSchedule ServiceAssetType = "schedule" // 排期服务
ServiceAssetTypeBooking ServiceAssetType = "booking" // 预订服务
)
// VirtualAssetType 虚拟资产子类型
type VirtualAssetType string
const (
VirtualAssetTypeNFT VirtualAssetType = "nft" // NFT数字藏品
VirtualAssetTypeCoupon VirtualAssetType = "coupon" // 优惠券
VirtualAssetTypeVoucher VirtualAssetType = "voucher" // 兑换券
VirtualAssetTypeTicket VirtualAssetType = "ticket" // 门票
)

View File

@@ -0,0 +1,12 @@
package knapsack
// KnapsackStatus 背包项状态
type KnapsackStatus int
const (
KnapsackStatusDisabled KnapsackStatus = 0 // 禁用
KnapsackStatusActive KnapsackStatus = 1 // 启用(可用)
KnapsackStatusUsed KnapsackStatus = 2 // 已使用
KnapsackStatusListed KnapsackStatus = 3 // 已上架到市场
KnapsackStatusExpired KnapsackStatus = 4 // 已过期
)