mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 08:11:49 +08:00
修改ip pool策略
This commit is contained in:
@@ -5,17 +5,18 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// type IpMap struct {
|
||||
// Id int `json:"id" xorm:"pk autoincr not null"`
|
||||
// IpAddr string `json:"ip_addr" xorm:"not null unique"`
|
||||
// MacAddr string `json:"mac_addr" xorm:"not null unique"`
|
||||
// Username string `json:"username"`
|
||||
// Keep bool `json:"keep"` // 保留 ip-mac 绑定
|
||||
// KeepTime time.Time `json:"keep_time"`
|
||||
// Note string `json:"note"` // 备注
|
||||
// LastLogin time.Time `json:"last_login"`
|
||||
// UpdatedAt time.Time `json:"updated_at"`
|
||||
// }
|
||||
type IpMap struct {
|
||||
Id int `json:"id" xorm:"pk autoincr not null"`
|
||||
IpAddr string `json:"ip_addr" xorm:"varchar(32) not null unique"`
|
||||
MacAddr string `json:"mac_addr" xorm:"varchar(32) not null unique"`
|
||||
UniqueMac bool `json:"unique_mac" xorm:"Bool index"`
|
||||
Username string `json:"username" xorm:"varchar(60)"`
|
||||
Keep bool `json:"keep" xorm:"Bool"` // 保留 ip-mac 绑定
|
||||
KeepTime time.Time `json:"keep_time" xorm:"DateTime"`
|
||||
Note string `json:"note" xorm:"varchar(255)"` // 备注
|
||||
LastLogin time.Time `json:"last_login" xorm:"DateTime"`
|
||||
UpdatedAt time.Time `json:"updated_at" xorm:"DateTime updated"`
|
||||
}
|
||||
|
||||
func SetIpMap(v *IpMap) error {
|
||||
var err error
|
||||
|
@@ -30,7 +30,7 @@ type User struct {
|
||||
Email string `json:"email" xorm:"varchar(255)"`
|
||||
// Password string `json:"password"`
|
||||
PinCode string `json:"pin_code" xorm:"varchar(32)"`
|
||||
LimitTime *time.Time `json:"limittime,omitempty" xorm:"Datetime limittime"` //值为null时,前端不显示
|
||||
LimitTime *time.Time `json:"limittime,omitempty" xorm:"Datetime limittime"` // 值为null时,前端不显示
|
||||
OtpSecret string `json:"otp_secret" xorm:"varchar(255)"`
|
||||
DisableOtp bool `json:"disable_otp" xorm:"Bool"` // 禁用otp
|
||||
Groups []string `json:"groups" xorm:"Text"`
|
||||
@@ -56,19 +56,6 @@ type UserActLog struct {
|
||||
CreatedAt time.Time `json:"created_at" xorm:"DateTime created"`
|
||||
}
|
||||
|
||||
type IpMap struct {
|
||||
Id int `json:"id" xorm:"pk autoincr not null"`
|
||||
IpAddr string `json:"ip_addr" xorm:"varchar(32) not null unique"`
|
||||
MacAddr string `json:"mac_addr" xorm:"varchar(32) not null unique"`
|
||||
UniqueMac bool `json:"unique_mac" xorm:"Bool index"`
|
||||
Username string `json:"username" xorm:"varchar(60)"`
|
||||
Keep bool `json:"keep" xorm:"Bool"` // 保留 ip-mac 绑定
|
||||
KeepTime time.Time `json:"keep_time" xorm:"DateTime"`
|
||||
Note string `json:"note" xorm:"varchar(255)"` // 备注
|
||||
LastLogin time.Time `json:"last_login" xorm:"DateTime"`
|
||||
UpdatedAt time.Time `json:"updated_at" xorm:"DateTime updated"`
|
||||
}
|
||||
|
||||
type Setting struct {
|
||||
Id int `json:"id" xorm:"pk autoincr not null"`
|
||||
Name string `json:"name" xorm:"varchar(60) not null unique"`
|
||||
|
Reference in New Issue
Block a user