You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
809 B

package logger
import (
"recook/internal/dbc"
"time"
)
type UpKeepLog struct {
ID uint `gorm:"column:id" json:"id"`
Type int8 `gorm:"column:type" json:"type"`
UserId uint `gorm:"column:user_id" json:"user_id"`
OldRoleLevel int `gorm:"column:old_role_level" json:"old_rolel_evel"`
NewRoleLevel int `gorm:"column:new_role_level" json:"new_role_level"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
}
func (u *UpKeepLog) TableName() string {
return "recook_up_keep_log"
}
const InviterTenForUpKeepLogType = 10
func (u *UpKeepLog) SaveUpOrKeepLog(newRoleLevel, oldRoleLevel int, userId uint, logType int8) {
u.NewRoleLevel = newRoleLevel
u.OldRoleLevel = oldRoleLevel
u.UserId = userId
u.Type = logType
dbc.DB.Save(&u)
}