first commit
This commit is contained in:
39
server/loginserver/model/login.go
Normal file
39
server/loginserver/model/login.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
Login = iota
|
||||
Logout
|
||||
)
|
||||
|
||||
type LoginHistory struct {
|
||||
Id int `xorm:"id pk autoincr"`
|
||||
UId int `xorm:"uid"`
|
||||
CTime time.Time `xorm:"ctime"`
|
||||
Ip string `xorm:"ip"`
|
||||
State int8 `xorm:"state"`
|
||||
Hardware string `xorm:"hardware"`
|
||||
}
|
||||
|
||||
func (this *LoginHistory) TableName() string {
|
||||
return "tb_login_history"
|
||||
}
|
||||
|
||||
|
||||
type LoginLast struct {
|
||||
Id int `xorm:"id pk autoincr"`
|
||||
UId int `xorm:"uid"`
|
||||
LoginTime time.Time `xorm:"login_time"`
|
||||
LogoutTime time.Time `xorm:"logout_time"`
|
||||
Ip string `xorm:"ip"`
|
||||
Session string `xorm:"session"`
|
||||
IsLogout int8 `xorm:"is_logout"`
|
||||
Hardware string `xorm:"hardware"`
|
||||
}
|
||||
|
||||
func (this *LoginLast) TableName() string {
|
||||
return "tb_login_last"
|
||||
}
|
||||
19
server/loginserver/model/user.go
Normal file
19
server/loginserver/model/user.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type User struct {
|
||||
UId int `xorm:"uid pk autoincr"`
|
||||
Username string `xorm:"username" validate:"min=4,max=20,regexp=^[a-zA-Z0-9_]*$"`
|
||||
Passcode string `xorm:"passcode"`
|
||||
Passwd string `xorm:"passwd"`
|
||||
Hardware string `xorm:"hardware"`
|
||||
Status int `xorm:"status"`
|
||||
Ctime time.Time `xorm:"ctime"`
|
||||
Mtime time.Time `xorm:"mtime"`
|
||||
IsOnline bool `xorm:"-"`
|
||||
}
|
||||
|
||||
func (this *User) TableName() string {
|
||||
return "tb_user_info"
|
||||
}
|
||||
Reference in New Issue
Block a user