You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package models
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type Ipblack struct{
|
|
|
|
ID uint `gorm:"primary_key" json:"id"`
|
|
|
|
IP string `json:"ip"`
|
|
|
|
KefuId string `json:"kefu_id"`
|
|
|
|
CreateAt time.Time `json:"create_at"`
|
|
|
|
}
|
|
|
|
func CreateIpblack(ip string,kefuId string)uint{
|
|
|
|
black:=&Ipblack{
|
|
|
|
IP:ip,
|
|
|
|
KefuId: kefuId,
|
|
|
|
CreateAt: time.Now(),
|
|
|
|
}
|
|
|
|
DB.Create(black)
|
|
|
|
return black.ID
|
|
|
|
}
|
|
|
|
func FindIp(ip string)Ipblack{
|
|
|
|
var ipblack Ipblack
|
|
|
|
DB.Where("ip = ?", ip).First(&ipblack)
|
|
|
|
return ipblack
|
|
|
|
}
|