| 1234567891011121314151617181920212223242526 |
- package entity
- import "time"
- // TgBindToken Telegram绑定令牌表
- type TgBindToken struct {
- MysqlBaseModel
- Token string `json:"token" gorm:"type:varchar(64);uniqueIndex;comment:绑定令牌;NOT NULL"`
- TelegramId int64 `json:"telegramId" gorm:"index;comment:Telegram用户ID;NOT NULL"`
- TelegramUsername string `json:"telegramUsername" gorm:"type:varchar(255);comment:Telegram用户名"`
- UserId int64 `json:"userId" gorm:"type:bigint;default:0;comment:使用该令牌绑定的平台用户ID"`
- Status int `json:"status" gorm:"type:tinyint;default:0;comment:状态: 0=未使用, 1=已使用, 2=已过期"`
- ExpireAt time.Time `json:"expireAt" gorm:"type:timestamp;comment:过期时间;NOT NULL"`
- }
- func (*TgBindToken) TableName() string {
- return ModelPrefix + "tg_bind_token"
- }
- func (*TgBindToken) Comment() string {
- return "Telegram绑定令牌表"
- }
- func NewTgBindToken() *TgBindToken {
- return &TgBindToken{}
- }
|