123456789101112131415161718192021222324252627282930313233343536 |
- package model
- import (
- "time"
- "github.com/shopspring/decimal"
- "gorm.io/gorm"
- )
- const TableNameCreditUsage = "credit_usage"
- type CreditUsage struct {
- ID int64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
- CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;comment:Create Time | 创建日期" json:"created_at"`
- UpdatedAt time.Time `gorm:"column:updated_at;not null;default:CURRENT_TIMESTAMP;comment:Update Time | 修改日期" json:"updated_at"`
- Status int64 `gorm:"column:status;not null;default:1;comment:状态 1 正常 2 禁用" json:"status"`
- DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:Delete Time | 删除日期" json:"deleted_at"`
- UserID string `gorm:"column:user_id;not null;comment:用户ID" json:"user_id"`
- Number decimal.Decimal `gorm:"column:number;not null;default:0.0000;comment:积分改变量" json:"number"`
- Ntype int64 `gorm:"column:ntype;not null;default:1;comment:积分变化类型:1-消耗 2-增加" json:"ntype"`
- MTable string `gorm:"column:table;not null;comment:积分变化表名" json:"table"`
- Nid int64 `gorm:"column:nid;not null;comment:积分变化关联信息ID" json:"nid"`
- Reason string `gorm:"column:reason;comment:积分变动原因" json:"reason"`
- Operator string `gorm:"column:operator;comment:积分调整人" json:"operator"`
- OrganizationID int64 `gorm:"column:organization_id;not null;default:1;comment:机构 ID" json:"organization_id"`
- }
- func (*CreditUsage) TableName() string {
- return TableNameCreditUsage
- }
|