You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
431 B
Go
25 lines
431 B
Go
package models
|
|
|
|
import (
|
|
"github.com/astaxie/beego/orm"
|
|
)
|
|
|
|
func init() {
|
|
orm.RegisterModelWithPrefix("cm_", new(Ip))
|
|
}
|
|
|
|
type Ip struct {
|
|
Id string `orm:"pk" json:"id"`
|
|
Ip string `json:"ip"`
|
|
Updatetime string `json:"updatetime"`
|
|
}
|
|
|
|
func GetIpById(id string) string {
|
|
ipModel := new(Ip)
|
|
err := orm.NewOrm().QueryTable(new(Ip)).Filter("id", id).One(ipModel)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return ipModel.Ip
|
|
}
|