bindbox-game/internal/repository/mysql/model/activity_reward_settings.gen.go
Zuncle 46b9555823 feat(fragment): 商品成本价 + 活动奖品单次产出数量
- products 表新增 cost_price 字段(成本价/分)
- activity_reward_settings 新增 drop_quantity(单次产出数量,默认1)
  和 cost_snapshot_cents(成本价快照)
- 奖品创建/修改时自动快照成本价,drop_quantity 限制 1-100
- 抽奖发放逻辑按 drop_quantity 循环创建多个库存项
- 抽奖结果接口按 drop_quantity 返回多条 item,前端自动合并显示
- 抽奖记录接口返回 drop_quantity 字段
- 商品管理 API 全链路支持 cost_price
2026-03-23 22:26:06 +08:00

40 lines
3.3 KiB
Go
Executable File
Raw 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.

// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package model
import (
"time"
"gorm.io/gorm"
)
const TableNameActivityRewardSettings = "activity_reward_settings"
// ActivityRewardSettings 活动期-奖励配置
type ActivityRewardSettings struct {
ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键ID" json:"id"` // 主键ID
CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP(3);comment:创建时间" json:"created_at"` // 创建时间
UpdatedAt time.Time `gorm:"column:updated_at;not null;default:CURRENT_TIMESTAMP(3);comment:更新时间" json:"updated_at"` // 更新时间
IssueID int64 `gorm:"column:issue_id;not null;comment:期IDactivity_issues.id" json:"issue_id"` // 期IDactivity_issues.id
ProductID int64 `gorm:"column:product_id;comment:奖品对应商品ID实物奖可填" json:"product_id"` // 奖品对应商品ID实物奖可填
PriceSnapshotCents int64 `gorm:"column:price_snapshot_cents;not null;comment:奖品配置时商品价格快照(分)" json:"price_snapshot_cents"` // 奖品配置时商品价格快照(分)
PriceSnapshotAt time.Time `gorm:"column:price_snapshot_at;comment:奖品价格快照时间" json:"price_snapshot_at"` // 奖品价格快照时间
Weight int32 `gorm:"column:weight;not null;comment:抽中权重(越大越易中)" json:"weight"` // 抽中权重(越大越易中)
Quantity int64 `gorm:"column:quantity;not null;comment:当前可发数量(扣减)" json:"quantity"` // 当前可发数量(扣减)
OriginalQty int64 `gorm:"column:original_qty;not null;comment:初始配置数量" json:"original_qty"` // 初始配置数量
Level int32 `gorm:"column:level;not null;comment:奖级如1=S 2=A 3=B" json:"level"` // 奖级如1=S 2=A 3=B
Sort int32 `gorm:"column:sort;comment:排序" json:"sort"` // 排序
IsBoss int32 `gorm:"column:is_boss;comment:Boss 1 是 0 不是" json:"is_boss"` // Boss 1 是 0 不是
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
MinScore int64 `gorm:"column:min_score;not null;comment:最低得分/碰数要求" json:"min_score"` // 最低得分/碰数要求
DropQuantity int32 `gorm:"column:drop_quantity;not null;default:1;comment:单次抽中产出数量" json:"drop_quantity"` // 单次抽中产出数量
CostSnapshotCents int64 `gorm:"column:cost_snapshot_cents;not null;default:0;comment:奖品配置时成本价快照(分)" json:"cost_snapshot_cents"` // 奖品配置时成本价快照(分)
}
// TableName ActivityRewardSettings's table name
func (*ActivityRewardSettings) TableName() string {
return TableNameActivityRewardSettings
}