package model

import (
	"gorm.io/plugin/soft_delete"
	"time"
)

const (
	Status_In  = 1
	Status_Out = 2
	Status_Off = 3
)

//LoginLog 用户模型
type LoginLog struct {
	ID         uint    `gorm:"primarykey"`
	Domain     *string `gorm:"type:varchar(32);column:domain;default:'';comment:domain" json:"domian"` //过期时间
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DeletedAt  soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11)" json:"deletedAt"`
	UserId     uint                  `gorm:"type:int(11);column:user_id;default:0;comment:绑定的用户id" json:"userId"`                 //绑定的用户id
	Uuid       string                `gorm:"type:char(16);column:uuid;default:'';comment:uuid" json:"uuid"`                       //绑定的用户id
	Ip         string                `gorm:"type:varchar(50);column:ip;default:'';comment:ip地址" json:"Ip"`                        //登录的ip
	Token      string                `gorm:"type:text;column:token;default:;comment:token信息" json:"token"`                        //token
	Status     uint8                 `gorm:"type:tinyint;column:status;default:1;comment:状态(1-登陆中 2-登出)" json:"status"`           //status状态
	ExpireDate string                `gorm:"type:varchar(32);column:expire_date;default:'';comment:token过期日期" json:"expire_date"` //过期时间
	LastDate   string                `gorm:"type:varchar(32);column:last_date;default:'';comment:最后活跃时间" json:"lastDate"`         //status状态
	LogoutDate string                `gorm:"type:varchar(32);column:logout_date;default:'';comment:登出时间" json:"logoutDate"`       //status状态
	Address    string                `gorm:"type:varchar(32);column:address;default:'';comment:地址" json:"address"`                //status状态
}
