micro-account/pkg/model/refresh_token.go
2025-02-20 16:18:23 +08:00

24 lines
957 B
Go

package model
import (
"time"
)
const (
IsForBid_Yes = 1
IsForBid_No = 2
UseNum_Max = 15
)
//RefreshToken 长期有效刷新token
type RefreshToken struct {
ID uint `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
RefreshToken string `gorm:"uniqueIndex:un_token;type:varchar(256);column:refresh_token;default:'';comment:refresh_token" json:"refreshToken"`
ExpireDate string `gorm:"type:varchar(32);column:expire_date;default:'';comment:token过期日期" json:"expire_date"` //过期时间
UseNum uint8 `gorm:"type:tinyint;column:use_num;default:0;comment:使用次数" json:"useNum"` //使用次数
LastUseDate string `gorm:"type:varchar(32);column:last_use_date;default:'';comment:上次使用的时间" json:"lastUseDate"` //使用次数
IsForbid uint8 `gorm:"type:tinyint;column:status;default:1;comment:状态(1-禁用 2-可用)" json:"IsForbid"` //status状态
}