feat:优化项目信息

This commit is contained in:
henry
2021-12-01 11:31:55 +08:00
parent edb9253c86
commit c27e115517
21 changed files with 203 additions and 28 deletions

View File

@ -1,14 +1,24 @@
package model
// UserConsume 用户资产消耗
// UserConsume 用户资产消耗数据模型
type UserConsume struct {
Model
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
Source int `json:"source"`
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
Source UserConsumeSource `gorm:"column:source;type:tinyiny(1);default:null;comment:消耗来源" json:"source"`
Consume float64 `gorm:"column:consume;type:decimal(10,2);default:null;comment:消耗数量" json:"consume"`
Surplus float64 `gorm:"column:surplus;type:decimal(10,2);default:null;comment:剩余数量" json:"surplus"`
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注信息" json:"remark"`
ModelDeleted
ModelAt
}
type UserConsumeSource int
const (
// UserConsumeSourceForRecharge 充值
UserConsumeSourceForRecharge UserConsumeSource = iota + 1
)
func (m *UserConsume) TableName() string {
return "user_consume"
}