This commit is contained in:
solosw
2026-01-05 14:11:34 +08:00
parent 35ef825371
commit 99b11b04e4
658 changed files with 99266 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package models
import (
"time"
)
// ScoreRecord 积分记录表
type ScoreRecord struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
UserID uint `gorm:"type:int;not null;comment:用户编号" json:"user_id" binding:"required"`
ChangeNumber int `gorm:"type:int;not null;comment:变化数量" json:"change_number" binding:"required"`
Note string `gorm:"type:varchar(200);not null;comment:说明" json:"note" binding:"required"`
CreatedAt time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" json:"updated_at"`
// 关联关系
User User `gorm:"foreignKey:UserID" json:"user,omitempty"`
}
func (ScoreRecord) TableName() string {
return "score_records"
}