mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-02 23:40:24 +08:00
31 lines
584 B
Go
31 lines
584 B
Go
package entity
|
|
|
|
import (
|
|
"mayfly-go/pkg/model"
|
|
"time"
|
|
)
|
|
|
|
type Account struct {
|
|
model.Model
|
|
|
|
Username string `json:"username"`
|
|
Password string `json:"-"`
|
|
Status int8 `json:"status"`
|
|
LastLoginTime *time.Time `json:"lastLoginTime"`
|
|
LastLoginIp string `json:"lastLoginIp"`
|
|
}
|
|
|
|
func (a *Account) TableName() string {
|
|
return "t_sys_account"
|
|
}
|
|
|
|
// 是否可用
|
|
func (a *Account) IsEnable() bool {
|
|
return a.Status == AccountEnableStatus
|
|
}
|
|
|
|
const (
|
|
AccountEnableStatus int8 = 1 // 启用状态
|
|
AccountDisableStatus int8 = -1 // 禁用状态
|
|
)
|