| 1234567891011121314151617181920212223242526272829303132333435363738 |
- package entity
- import "github.com/shopspring/decimal"
- // todo:每批次奖励计算与发放统计数据
- // 记录每批次各类奖励总发放数量
- const (
- PeriodJobStateWaiting = "waiting" // 等待中
- PeriodJobStateRunning = "running" // 进行中
- PeriodJobStateSuccess = "success" // 成功
- PeriodJobStateFailure = "failure" // 失败
- )
- type StakePeriodJob struct {
- MysqlBaseModel
- PeriodNo string `json:"periodNo" gorm:"uniqueIndex;comment:期编号"`
- JobState string `json:"jobState" gorm:"type:varchar(32);comment:状态:running 进行中 success 成功 failure 失败"`
- Price decimal.Decimal `json:"price" gorm:"type:decimal(25,8);default:0;comment:当期单价"`
- // todo: 静态奖励数量 动态奖励数量 节点奖励数量 排行榜奖励数量...
- StaticSymbolProfit decimal.Decimal `json:"staticSymbolProfit" gorm:"type:decimal(25,8);default:0;comment:期静态币总收益"`
- StaticUsdProfit decimal.Decimal `json:"staticUsdProfit" gorm:"type:decimal(25,8);default:0;comment:期USD总收益"`
- LevelProfit decimal.Decimal `json:"levelProfit" gorm:"type:decimal(25,8);default:0;comment:动态等级奖励"`
- LevelProfitIsCal bool `json:"levelProfitIsCal" gorm:"default:0;comment:动态等级奖励是否计算完成"`
- Desc string `json:"desc" gorm:"type:text;comment:错误信息"`
- }
- func (*StakePeriodJob) TableName() string {
- return SysModelPrefix + "stake_period_job"
- }
- func (*StakePeriodJob) Comment() string {
- return "质押期任务"
- }
- func NewStakePeriodJob() *StakePeriodJob {
- return &StakePeriodJob{}
- }
|